Esempio n. 1
0
    def test_it_returns_annotations_by_ids(self, db_session, factories):
        annotations = factories.Annotation.create_batch(3)
        ids = [a.id for a in annotations]

        result = fetch_annotations(db_session, ids)

        assert annotations == result
Esempio n. 2
0
    def test_it_returns_replies_by_ids(self, db_session, factories):
        replies = [factories.Annotation() for _ in xrange(3)]
        ids = [a.id for a in replies]

        _, result = fetch_annotations(db_session, [], ids)

        assert replies == result
Esempio n. 3
0
    def test_it_returns_annotations_by_ids(self, db_session, factories):
        annotations = [factories.Annotation() for _ in xrange(3)]
        ids = [a.id for a in annotations]

        result = fetch_annotations(db_session, ids)

        assert annotations == result
Esempio n. 4
0
    def test_it_returns_annotations_by_ids(self, db_session, factories):
        annotations = [factories.Annotation() for _ in xrange(3)]
        ids = [a.id for a in annotations]

        result, _ = fetch_annotations(db_session, ids, [])

        assert annotations == result
Esempio n. 5
0
    def test_it_returns_annotations_by_ids(self, db_session, factories):
        annotations = factories.Annotation.create_batch(3)
        ids = [a.id for a in annotations]

        result = fetch_annotations(db_session, ids)

        assert annotations == result
Esempio n. 6
0
    def test_it_returns_replies_by_ids(self, db_session, factories):
        replies = [factories.Annotation() for _ in xrange(3)]
        ids = [a.id for a in replies]

        _, result = fetch_annotations(db_session, [], ids)

        assert replies == result
Esempio n. 7
0
 def test_it_returns_empty_list_when_no_reply_ids_provided(self, db_session):
     _, result = fetch_annotations(db_session, [], [])
     assert result == []
Esempio n. 8
0
 def test_it_returns_empty_list_when_no_reply_ids_provided(
         self, db_session):
     _, result = fetch_annotations(db_session, [], [])
     assert result == []