← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~stevenk/launchpad/new-auditorclient into lp:launchpad

 

Steve Kowalik has proposed merging lp:~stevenk/launchpad/new-auditorclient into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~stevenk/launchpad/new-auditorclient/+merge/169971

Jump to a new auditorclient version, and add a test that checks multiple operations via one GET.
-- 
https://code.launchpad.net/~stevenk/launchpad/new-auditorclient/+merge/169971
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/new-auditorclient into lp:launchpad.
=== modified file 'lib/lp/services/auditor/tests/test_client.py'
--- lib/lp/services/auditor/tests/test_client.py	2012-08-06 04:45:06 +0000
+++ lib/lp/services/auditor/tests/test_client.py	2013-06-18 01:53:25 +0000
@@ -25,3 +25,21 @@
             u'comment': u'', u'details': u'', u'actor': actor,
             u'operation': u'packageupload-accepted', u'object': pu}]
         self.assertContentEqual(expected, result)
+
+    def test_multiple_receive(self):
+        # We can ask AuditorClient for a number of operations.
+        actor = self.factory.makePerson()
+        client = AuditorClient()
+        client.send(actor, 'person-deleted', actor)
+        client.send(actor, 'person-undeleted', actor)
+        result = client.receive(
+            obj=actor, operation=('person-deleted', 'person-undeleted'))
+        self.assertEqual(2, len(result))
+        for r in result:
+            del r['date'] # Ignore the date.
+        expected = [
+            {u'comment': u'', u'details': u'', u'actor': actor,
+            u'operation': u'person-deleted', u'object': actor},
+            {u'comment': u'', u'details': u'', u'actor': actor,
+            u'operation': u'person-undeleted', u'object': actor}]
+        self.assertContentEqual(expected, result)

=== modified file 'versions.cfg'
--- versions.cfg	2013-06-14 01:25:49 +0000
+++ versions.cfg	2013-06-18 01:53:25 +0000
@@ -12,7 +12,7 @@
 anyjson = 0.3.3
 argparse = 1.2.1
 auditor = 0.0.3
-auditorclient = 0.0.2
+auditorclient = 0.0.3
 auditorfixture = 0.0.5
 BeautifulSoup = 3.2.1
 bson = 0.3.3


Follow ups