示例#1
0
def test_from_dict():

    b = Bookmark.from_dict(d)

    assert b._data['tags'] == d['tags']
    assert b._data['url'] == d['url']
    assert b._data['notes'] == None
示例#2
0
def test_load():
    """ load from db """

    data = yaml.load(open(dataFile, 'r'))

    # create classes
    B = [Bookmark.from_dict(d) for d in data]

    return B
示例#3
0
def test_attr():

    b = Bookmark.from_dict(d)
    assert b.url == d['url']

    assert b._data == unpack(d)
示例#4
0
def test_to_dict():

    b = Bookmark.from_dict(d)
    assert b.to_dict() == d

    print(b.to_dict())