class StatusTestCase(unittest.TestCase): def setUp(self): self.timeout = 0.5 twisted.internet.base.DelayedCall.debug = True self.mock_dynamodb2 = mock_dynamodb2() self.mock_dynamodb2.start() self.settings = StatusHandler.ap_settings = AutopushSettings( hostname="localhost", statsd_host=None, ) self.request_mock = Mock() self.status = StatusHandler(Application(), self.request_mock) self.write_mock = self.status.write = Mock() def tearDown(self): self.mock_dynamodb2.stop() def test_status(self): self.status.get() self.write_mock.assert_called_with({ "status": "OK", "version": __version__ })
def setUp(self): self.timeout = 0.5 twisted.internet.base.DelayedCall.debug = True self.mock_dynamodb2 = mock_dynamodb2() self.mock_dynamodb2.start() self.settings = StatusHandler.ap_settings = AutopushSettings( hostname="localhost", statsd_host=None, ) self.request_mock = Mock() self.status = StatusHandler(Application(), self.request_mock) self.write_mock = self.status.write = Mock()