Skip to content

Commit

Permalink
Re-added test for StatsStorageBase
Browse files Browse the repository at this point in the history
  • Loading branch information
Prasoon Shukla committed Jul 31, 2015
1 parent 33e2530 commit 1a4b79a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions master/buildbot/test/unit/test_stats_service.py
Expand Up @@ -55,6 +55,16 @@ def tearDown(self):
self.stats_service.stopService()


class DummyStatsStorageBase(StatsStorageBase):

"""
A dummy class to test intialization of StatsStorageBase.
"""

def thd_postStatsValue(self, *args, **kwargs):
return defer.succeed(None)


class TestStatsServicesConfiguration(TestStatsServicesBase):

def test_reconfig_with_no_storage_backends(self):
Expand Down Expand Up @@ -154,6 +164,13 @@ def test_influx_service_not_inited(self):
svc.thd_postStatsValue("test", "test", "test")
self.assertLogged("Service.*not initialized")

def test_storage_backend_base_failure_on_init(self):
svc = DummyStatsStorageBase()

r = svc.thd_postStatsValue("test", "test", "test")
assert isinstance(r, defer.Deferred)
assert r.result == None


class TestStatsServicesConsumers(steps.BuildStepMixin, TestStatsServicesBase):

Expand Down

0 comments on commit 1a4b79a

Please sign in to comment.