def test_duplicates_get_removed(self): c = Collector() c.add_linked('people', 1, {'id': 1}) c.add_linked('people', 1, {'id': 1}) c.add_linked('people', 2, {'id': 2}) assert c.get_linked_dict() == { 'people': [ {'id': 1}, {'id': 2}, ], }
def test_linked_items_get_sorted(self): c = Collector() c.add_linked('people', 1, {'id': 1}) c.add_linked('people', 3, {'id': 3}) c.add_linked('people', 2, {'id': 2}) assert c.get_linked_dict() == { 'people': [ {'id': 1}, {'id': 2}, {'id': 3}, ], }
def test_duplicates_get_removed(self): c = Collector() c.add_linked('people', 1, {'id': 1}) c.add_linked('people', 1, {'id': 1}) c.add_linked('people', 2, {'id': 2}) assert c.get_linked_dict() == { 'people': [ { 'id': 1 }, { 'id': 2 }, ], }
def test_linked_items_get_sorted(self): c = Collector() c.add_linked('people', 1, {'id': 1}) c.add_linked('people', 3, {'id': 3}) c.add_linked('people', 2, {'id': 2}) assert c.get_linked_dict() == { 'people': [ { 'id': 1 }, { 'id': 2 }, { 'id': 3 }, ], }