示例#1
0
def test_foreign_object():
    class ForeignObject:
        def dumps(self):
            return 15

        def __str__(self):
            return TEST_STR

    assert _latex_item_to_string(ForeignObject()) == TEST_STR
示例#2
0
def test_string():
    name = 'abc'
    assert _latex_item_to_string(name) == name
示例#3
0
def test_user_latex_object():
    class TestLatexObject(LatexObject):
        def dumps(self):
            return TEST_STR

    assert _latex_item_to_string(TestLatexObject()) == TEST_STR