def test_Extension_postprocess(): opt = {'extension': {sqrt(2)}} Extension.postprocess(opt) assert opt == { 'extension': {sqrt(2)}, 'domain': QQ.algebraic_field(sqrt(2)), } opt = {'extension': True} Extension.postprocess(opt) assert opt == {'extension': True}
def test_Extension_postprocess(): opt = {'extension': {sqrt(2)}} Extension.postprocess(opt) assert opt == { 'extension': {sqrt(2)}, 'domain': QQ.algebraic_field(sqrt(2)), } opt = {'extension': True} Extension.postprocess(opt) assert opt == {'extension': True}
def test_Extension_preprocess(): assert Extension.preprocess(True) is True assert Extension.preprocess(1) is True assert Extension.preprocess([]) is None assert Extension.preprocess(sqrt(2)) == {sqrt(2)} assert Extension.preprocess([sqrt(2)]) == {sqrt(2)} assert Extension.preprocess([sqrt(2), I]) == {sqrt(2), I} pytest.raises(OptionError, lambda: Extension.preprocess(False)) pytest.raises(OptionError, lambda: Extension.preprocess(0))
def test_Extension_preprocess(): assert Extension.preprocess(True) is True assert Extension.preprocess(1) is True assert Extension.preprocess(False) is False assert Extension.preprocess([]) is None assert Extension.preprocess(sqrt(2)) == {sqrt(2)} assert Extension.preprocess([sqrt(2)]) == {sqrt(2)} assert Extension.preprocess([sqrt(2), I]) == {sqrt(2), I}
def test_Extension_preprocess(): assert Extension.preprocess(True) is True assert Extension.preprocess(1) is True assert Extension.preprocess(False) is False assert Extension.preprocess([]) is None assert Extension.preprocess(sqrt(2)) == {sqrt(2)} assert Extension.preprocess([sqrt(2)]) == {sqrt(2)} assert Extension.preprocess([sqrt(2), I]) == {sqrt(2), I}