예제 #1
0
파일: test_db.py 프로젝트: jk128/autopush
    def test_preflight_check_wait(self):
        router = Router(get_router_table(), SinkMetrics())
        message = Message(get_rotating_message_table(), SinkMetrics())

        values = ["PENDING", "ACTIVE"]
        message.table_status = Mock(side_effect=values)

        pf_uaid = "deadbeef00000000deadbeef01010101"
        preflight_check(message, router, pf_uaid)
        # now check that the database reports no entries.
        _, notifs = message.fetch_messages(uuid.UUID(pf_uaid))
        assert len(notifs) == 0
        with pytest.raises(ItemNotFound):
            router.get_uaid(pf_uaid)
예제 #2
0
    def test_preflight_check_wait(self):
        global test_router
        message = Message(
            get_rotating_message_tablename(boto_resource=self.resource),
            boto_resource=self.resource)

        values = ["PENDING", "ACTIVE"]
        message.table_status = Mock(side_effect=values)

        pf_uaid = "deadbeef00000000deadbeef01010101"
        preflight_check(message, test_router, pf_uaid)
        # now check that the database reports no entries.
        _, notifs = message.fetch_messages(uuid.UUID(pf_uaid))
        assert len(notifs) == 0
        with pytest.raises(ItemNotFound):
            self.router.get_uaid(pf_uaid)