コード例 #1
0
ファイル: test_dao.py プロジェクト: jaunis/xivo-dao
    def test_find_last_unprocessed_under_limit(self):
        limit = 10
        cel_id_1, cel_id_2 = self.add_cel(linkedid='1'), self.add_cel(linkedid='2')

        result = cel_dao.find_last_unprocessed(limit)

        assert_that(result, contains(has_property('id', cel_id_1),
                                     has_property('id', cel_id_2)))
コード例 #2
0
ファイル: test_dao.py プロジェクト: jaunis/xivo-dao
    def test_find_last_unprocessed_with_only_processed(self):
        limit = 10
        self._add_processed_cel()
        self._add_processed_cel()

        result = cel_dao.find_last_unprocessed(limit)

        assert_that(result, contains())
コード例 #3
0
ファイル: test_dao.py プロジェクト: jaunis/xivo-dao
    def test_find_last_unprocessed_under_limit_exceeding_limit_to_complete_call(self):
        limit = 1
        cel_id_1, cel_id_2 = self.add_cel(linkedid='1'), self.add_cel(linkedid='1')

        result = cel_dao.find_last_unprocessed(limit)

        assert_that(result, contains(has_property('id', cel_id_1),
                                     has_property('id', cel_id_2)))
コード例 #4
0
ファイル: test_dao.py プロジェクト: jaunis/xivo-dao
    def test_find_last_unprocessed_with_only_processed(self):
        limit = 10
        self._add_processed_cel()
        self._add_processed_cel()

        result = cel_dao.find_last_unprocessed(limit)

        assert_that(result, contains())
コード例 #5
0
ファイル: test_dao.py プロジェクト: jaunis/xivo-dao
    def test_find_last_unprocessed_with_processed_and_unprocessed(self):
        limit = 10
        self._add_processed_cel(linkedid='1')
        self._add_processed_cel(linkedid='1')
        cel_id_3, cel_id_4 = self.add_cel(linkedid='2'), self.add_cel(linkedid='2')

        result = cel_dao.find_last_unprocessed(limit)

        assert_that(result, contains(has_property('id', cel_id_3),
                                     has_property('id', cel_id_4)))
コード例 #6
0
ファイル: test_dao.py プロジェクト: jaunis/xivo-dao
    def test_find_last_unprocessed_under_limit_exceeding_limit_to_reprocess_partially_processed_call(self):
        limit = 2
        cel_id_1, cel_id_2 = self._add_processed_cel(linkedid='1'), self.add_cel(linkedid='1')
        cel_id_3, cel_id_4 = self._add_processed_cel(linkedid='2'), self.add_cel(linkedid='2')

        result = cel_dao.find_last_unprocessed(limit)

        assert_that(result, contains(has_property('id', cel_id_1),
                                     has_property('id', cel_id_2),
                                     has_property('id', cel_id_3),
                                     has_property('id', cel_id_4)))
コード例 #7
0
ファイル: test_dao.py プロジェクト: jaunis/xivo-dao
    def test_find_last_unprocessed_under_limit(self):
        limit = 10
        cel_id_1, cel_id_2 = self.add_cel(linkedid='1'), self.add_cel(
            linkedid='2')

        result = cel_dao.find_last_unprocessed(limit)

        assert_that(
            result,
            contains(has_property('id', cel_id_1),
                     has_property('id', cel_id_2)))
コード例 #8
0
ファイル: test_dao.py プロジェクト: jaunis/xivo-dao
    def test_find_last_unprocessed_under_limit_exceeding_limit_to_complete_call(
            self):
        limit = 1
        cel_id_1, cel_id_2 = self.add_cel(linkedid='1'), self.add_cel(
            linkedid='1')

        result = cel_dao.find_last_unprocessed(limit)

        assert_that(
            result,
            contains(has_property('id', cel_id_1),
                     has_property('id', cel_id_2)))
コード例 #9
0
ファイル: test_dao.py プロジェクト: jaunis/xivo-dao
    def test_find_last_unprocessed_with_processed_and_unprocessed(self):
        limit = 10
        self._add_processed_cel(linkedid='1')
        self._add_processed_cel(linkedid='1')
        cel_id_3, cel_id_4 = self.add_cel(linkedid='2'), self.add_cel(
            linkedid='2')

        result = cel_dao.find_last_unprocessed(limit)

        assert_that(
            result,
            contains(has_property('id', cel_id_3),
                     has_property('id', cel_id_4)))
コード例 #10
0
ファイル: test_dao.py プロジェクト: jaunis/xivo-dao
    def test_find_last_unprocessed_under_limit_exceeding_limit_to_reprocess_partially_processed_call(
            self):
        limit = 2
        cel_id_1, cel_id_2 = self._add_processed_cel(
            linkedid='1'), self.add_cel(linkedid='1')
        cel_id_3, cel_id_4 = self._add_processed_cel(
            linkedid='2'), self.add_cel(linkedid='2')

        result = cel_dao.find_last_unprocessed(limit)

        assert_that(
            result,
            contains(has_property('id',
                                  cel_id_1), has_property('id', cel_id_2),
                     has_property('id', cel_id_3),
                     has_property('id', cel_id_4)))
コード例 #11
0
ファイル: test_dao.py プロジェクト: jaunis/xivo-dao
    def test_find_last_unprocessed_no_cels(self):
        limit = 10

        result = cel_dao.find_last_unprocessed(limit)

        assert_that(result, contains())
コード例 #12
0
ファイル: test_dao.py プロジェクト: jaunis/xivo-dao
    def test_find_last_unprocessed_no_cels(self):
        limit = 10

        result = cel_dao.find_last_unprocessed(limit)

        assert_that(result, contains())