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
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
def test_attr(): b = Bookmark.from_dict(d) assert b.url == d['url'] assert b._data == unpack(d)
def test_to_dict(): b = Bookmark.from_dict(d) assert b.to_dict() == d print(b.to_dict())