Skip to content

Commit

Permalink
Use different logic code. Update py 2.6.
Browse files Browse the repository at this point in the history
  • Loading branch information
adiroiban committed Mar 4, 2015
1 parent e45a64b commit 602929a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion master/buildbot/status/builder.py
Expand Up @@ -337,7 +337,7 @@ def setTags(self, tags):

def matchesAnyTag(self, tags):
# Need to guard against None with the "or []".
return not set(self.tags or []).isdisjoint(tags)
return bool(set(self.tags or []) & set(tags))

def matchesAllTags(self, tags):
# Need to guard against None with the "or []".
Expand Down
10 changes: 5 additions & 5 deletions master/buildbot/test/unit/test_status_builder.py
Expand Up @@ -43,7 +43,7 @@ def test_matchesAnyTag_no_tags(self):
sut = self.makeBuilderStatus()

self.assertFalse(sut.matchesAnyTag(set()))
self.assertFalse(sut.matchesAnyTag({'any-tag', 'tag'}))
self.assertFalse(sut.matchesAnyTag(set(('any-tag', 'tag')))

def test_matchesAnyTag_no_match(self):
"""
Expand All @@ -53,8 +53,8 @@ def test_matchesAnyTag_no_match(self):
sut.tags = {'one'}

self.assertFalse(sut.matchesAnyTag(set()))
self.assertFalse(sut.matchesAnyTag({'no-such-tag'}))
self.assertFalse(sut.matchesAnyTag({'other-tag', 'tag'}))
self.assertFalse(sut.matchesAnyTag(set('no-such-tag')))
self.assertFalse(sut.matchesAnyTag(set('other-tag', 'tag')))

def test_matchesAnyTag_with_match(self):
"""
Expand All @@ -63,5 +63,5 @@ def test_matchesAnyTag_with_match(self):
sut = self.makeBuilderStatus()
sut.tags = {'one', 'two'}

self.assertTrue(sut.matchesAnyTag({'two'}))
self.assertTrue(sut.matchesAnyTag({'two', 'one'}))
self.assertTrue(sut.matchesAnyTag(set('two')))
self.assertTrue(sut.matchesAnyTag(set('two', 'one')))

0 comments on commit 602929a

Please sign in to comment.