diff --git a/did/plugins/bugzilla.py b/did/plugins/bugzilla.py index 845f5e0a..a77997ee 100644 --- a/did/plugins/bugzilla.py +++ b/did/plugins/bugzilla.py @@ -31,8 +31,8 @@ --bz-returned Bugs returned --bz-verified Bugs verified --bz-commented Bugs commented - --bz-closed Bugs closed --bz-subscribed Bugs subscribed + --bz-closed Bugs closed --bz All above """ @@ -561,7 +561,7 @@ def fetch(self): class SubscribedBugs(Stats): """ - Bugs Subscribed (CCed) + Bugs subscribed All bugs subscribed by given user in requested time frame. """ @@ -586,9 +586,7 @@ def fetch(self): "v4": self.user.email, } bugs = self.parent.bugzilla.search(query, options=self.options) - self.stats = [ - bug for bug in bugs - if bug.subscribed(self.user)] + self.stats = [bug for bug in bugs if bug.subscribed(self.user)] class BugzillaStats(StatsGroup): @@ -632,6 +630,6 @@ def __init__(self, option, name=None, parent=None, user=None): ReturnedBugs(option=option + "-returned", parent=self), VerifiedBugs(option=option + "-verified", parent=self), CommentedBugs(option=option + "-commented", parent=self), - ClosedBugs(option=option + "-closed", parent=self), SubscribedBugs(option=option + "-subscribed", parent=self), + ClosedBugs(option=option + "-closed", parent=self), ] diff --git a/tests/plugins/test_bugzilla.py b/tests/plugins/test_bugzilla.py index 5698fad1..fd0e2186 100644 --- a/tests/plugins/test_bugzilla.py +++ b/tests/plugins/test_bugzilla.py @@ -85,6 +85,21 @@ def test_bugzilla_returned(): assert not any([bug.id == 1229704 for bug in stats]) +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# Subscribed Bugs +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +def test_bugzilla_subscribed(): + """ Check subscribed bugs """ + did.base.Config(CONFIG) + stats = did.cli.main([ + "--bz-subscribed", + "--email", "Evgeni Golov ", + "--since", "2016-06-06", + "--until", "2016-06-12"])[0][0].stats[0].stats[7].stats + assert any([bug.id == 1343546 for bug in stats]) + + # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Closed Bugs # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -96,21 +111,6 @@ def test_bugzilla_closed(): "--bz-closed", "--email", "Petr Šplíchal ", "--since", "2012-12-06", - "--until", "2012-12-06"])[0][0].stats[0].stats[7].stats + "--until", "2012-12-06"])[0][0].stats[0].stats[8].stats assert any([bug.id == 862231 for bug in stats]) assert any(["[duplicate]" in unicode(bug) for bug in stats]) - - -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Subscribed Bugs -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -def test_bugzilla_subscribed(): - """ Check subscribed bugs """ - did.base.Config(CONFIG) - stats = did.cli.main([ - "--bz-subscribed", - "--email", "Evgeni Golov ", - "--since", "2016-06-06", - "--until", "2016-06-12"])[0][0].stats[0].stats[8].stats - assert any([bug.id == 1343546 for bug in stats])