Exemplo n.º 1
0
    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)))
Exemplo n.º 2
0
    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())
Exemplo n.º 3
0
    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)))
Exemplo n.º 4
0
    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())
Exemplo n.º 5
0
    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)))
Exemplo n.º 6
0
    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)))
Exemplo n.º 7
0
    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)))
Exemplo n.º 8
0
    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)))
Exemplo n.º 9
0
    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)))
Exemplo n.º 10
0
    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)))
Exemplo n.º 11
0
    def test_find_last_unprocessed_no_cels(self):
        limit = 10

        result = cel_dao.find_last_unprocessed(limit)

        assert_that(result, contains())
Exemplo n.º 12
0
    def test_find_last_unprocessed_no_cels(self):
        limit = 10

        result = cel_dao.find_last_unprocessed(limit)

        assert_that(result, contains())