예제 #1
0
def test_other_from_str():
    o = Node.from_str(dumps(dict(test="test")))
    assert type(o) == dict
    assert type(o["test"]) == str
예제 #2
0
def test_new_from_str():
    d = Node(TEST_DATA)
    dd = Node.from_str(str(d), new=True)
    assert str(dd) != str(d)
예제 #3
0
def test_dict_from_str():
    dico = Node.from_str(dumps(dict(test=Node().toDict())))
    assert type(dico) == dict
    assert type(dico["test"]) == NodeBaseClass
예제 #4
0
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
예제 #5
0
def test_from_str():
    d = Node(TEST_DATA)
    dd = Node.from_str(str(d))
    assert str(dd) == str(d)