예제 #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())