File size: 600 Bytes
512509e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from types import SimpleNamespace

from app.services.numeric_validator import _extract_first_useful_wolfram_text


def test_extracts_rhs_from_wolfram_derivative_plaintext() -> None:
    pods = [
        SimpleNamespace(
            title="Derivative",
            plaintext="d/dx(x^2) = 2 x",
        )
    ]

    assert _extract_first_useful_wolfram_text(pods) == "2 x"


def test_extracts_plaintext_without_equals() -> None:
    pods = [
        SimpleNamespace(
            title="Result",
            plaintext="2 x",
        )
    ]

    assert _extract_first_useful_wolfram_text(pods) == "2 x"