Skip to content

Commit

Permalink
ensure that summaryUnsubscribe succeeds
Browse files Browse the repository at this point in the history
`summaryUnsubscribe` shoud be callable even if `summarySubscribe` hasn't
been called.  Fixes #2756.
  • Loading branch information
djmitche committed Apr 14, 2014
1 parent d3364bf commit cf4c10c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions master/buildbot/status/buildset.py
Expand Up @@ -74,6 +74,8 @@ def asDict(self):

class BuildSetSummaryNotifierMixin:

_buildSetSubscription = None

def summarySubscribe(self):
self._buildSetSubscription = self.master.subscribeToBuildsetCompletions(self._buildsetComplete)

Expand Down
4 changes: 4 additions & 0 deletions master/buildbot/test/unit/test_status_buildset.py
Expand Up @@ -95,3 +95,7 @@ def check(_):
self.assertEqual(builds, info['builds'])

self.assertEqual(buildset['bsid'], info['bsid'])

def test_unsub_with_no_sub(self):
notifier = BuildSetSummaryNotifierMixin()
notifier.summaryUnsubscribe()

0 comments on commit cf4c10c

Please sign in to comment.