def test_other_from_str(): o = Node.from_str(dumps(dict(test="test"))) assert type(o) == dict assert type(o["test"]) == str
def test_new_from_str(): d = Node(TEST_DATA) dd = Node.from_str(str(d), new=True) assert str(dd) != str(d)
def test_dict_from_str(): dico = Node.from_str(dumps(dict(test=Node().toDict()))) assert type(dico) == dict assert type(dico["test"]) == NodeBaseClass
def test_list_from_str(): lst = Node.from_str(dumps([Node().toDict(), Node()])) assert type(lst) == list for d in lst: assert type(d) == NodeBaseClass
def test_from_str(): d = Node(TEST_DATA) dd = Node.from_str(str(d)) assert str(dd) == str(d)