guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 10/10] gnu: Add python-barbicanclient.


From: Cyril Roelandt
Subject: [PATCH 10/10] gnu: Add python-barbicanclient.
Date: Fri, 29 Apr 2016 16:21:03 +0200

* gnu/packages/openstack.scm (python-barbicanclient, python2-barbicanclient):
New variables.
* gnu/packages/patches/python-barbicanclient-assertItemsEqual.patch: New file.
* gnu/local.ml: Add it here.
---
 gnu/local.mk                                       |  1 +
 gnu/packages/openstack.scm                         | 47 +++++++++++++++++++++
 .../python-barbicanclient-assertItemsEqual.patch   | 48 ++++++++++++++++++++++
 3 files changed, 96 insertions(+)
 create mode 100644 
gnu/packages/patches/python-barbicanclient-assertItemsEqual.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 7e65c86..e47aba8 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -690,6 +690,7 @@ dist_patch_DATA =                                           
\
   gnu/packages/patches/pybugz-stty.patch                       \
   gnu/packages/patches/pygpgme-disable-problematic-tests.patch  \
   gnu/packages/patches/pyqt-configure.patch                    \
+  gnu/packages/patches/python-barbicanclient-assertItemsEqual.patch \
   gnu/packages/patches/python-2-deterministic-build-info.patch \
   gnu/packages/patches/python-2.7-search-paths.patch           \
   gnu/packages/patches/python-2.7-source-date-epoch.patch      \
diff --git a/gnu/packages/openstack.scm b/gnu/packages/openstack.scm
index d1e1fa0..50fc939 100644
--- a/gnu/packages/openstack.scm
+++ b/gnu/packages/openstack.scm
@@ -644,6 +644,53 @@ handling.")
 (define-public python2-oslo.utils
   (package-with-python2 python-oslo.utils))
 
+(define-public python-barbicanclient
+  (package
+    (name "python-barbicanclient")
+    (version "4.0.1")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append
+               "https://pypi.python.org/packages/93/3f/";
+               "9ffbb6f7241d300d9a9d3f4aa794efbb1c45f6c5a729c702bec933a399cf/"
+               "python-barbicanclient-" version ".tar.gz"))
+        (sha256
+          (base32
+            "0paxkhsfj9wal4z14caip9kggbaa99ni03cgivi3z138vc6jdbbd"))
+        (patches (search-patches
+                  ;; testtools.TestCase.assertItemsEqual does not exist in our
+                  ;; version of testtools. Remove this patch once we update
+                  ;;testtools.
+                  "python-barbicanclient-assertItemsEqual.patch"))))
+    (build-system python-build-system)
+    (propagated-inputs
+      `(("python-cliff" ,python-cliff)
+        ("python-keystoneclient" ,python-keystoneclient)
+        ("python-oslo.i18n" ,python-oslo.i18n)
+        ("python-oslo.serialization" ,python-oslo.serialization)
+        ("python-oslo.utils" ,python-oslo.utils)
+        ("python-pbr" ,python-pbr)
+        ("python-requests" ,python-requests)
+        ("python-six" ,python-six)))
+    (native-inputs
+      ;; Tests
+      `(("python-setuptools" ,python-setuptools)
+        ("python-mock" ,python-mock)
+        ("python-requests-mock" ,python-requests-mock)
+        ("python-testtools" ,python-testtools)
+        ("python-testrepository" ,python-testrepository)))
+    (home-page "http://www.openstack.org/";)
+    (synopsis
+      "Client Library for OpenStack Barbican Key Management API")
+    (description
+      "A client and a library for the OpenStack Barbican Key Management
+API")
+    (license asl2.0)))
+
+(define-public python2-barbicanclient
+  (package-with-python2 python-barbicanclient))
+
 (define-public python-keystoneclient
   (package
     (name "python-keystoneclient")
diff --git a/gnu/packages/patches/python-barbicanclient-assertItemsEqual.patch 
b/gnu/packages/patches/python-barbicanclient-assertItemsEqual.patch
new file mode 100644
index 0000000..43652c4
--- /dev/null
+++ b/gnu/packages/patches/python-barbicanclient-assertItemsEqual.patch
@@ -0,0 +1,48 @@
+diff --git a/barbicanclient/tests/test_containers.py 
b/barbicanclient/tests/test_containers.py
+index 1327216..0b785a9 100644
+--- a/barbicanclient/tests/test_containers.py
++++ b/barbicanclient/tests/test_containers.py
+@@ -17,6 +17,7 @@ import json
+ 
+ import mock
+ from oslo_utils import timeutils
++import six
+ 
+ from barbicanclient import acls
+ from barbicanclient.tests import test_client
+@@ -197,7 +198,7 @@ class 
WhenTestingContainers(test_client.BaseEntityResource):
+         container_req = json.loads(self.responses.last_request.text)
+         self.assertEqual(self.container.name, container_req['name'])
+         self.assertEqual('certificate', container_req['type'])
+-        self.assertItemsEqual(self.container.certificate_secret_refs_json,
++        six.assertCountEqual(self, 
self.container.certificate_secret_refs_json,
+                               container_req['secret_refs'])
+ 
+     def test_should_store_certificate_via_constructor(self):
+@@ -222,7 +223,7 @@ class 
WhenTestingContainers(test_client.BaseEntityResource):
+         container_req = json.loads(self.responses.last_request.text)
+         self.assertEqual(self.container.name, container_req['name'])
+         self.assertEqual('certificate', container_req['type'])
+-        self.assertItemsEqual(self.container.certificate_secret_refs_json,
++        six.assertCountEqual(self, 
self.container.certificate_secret_refs_json,
+                               container_req['secret_refs'])
+ 
+     def test_should_store_rsa_via_attributes(self):
+@@ -246,7 +247,7 @@ class 
WhenTestingContainers(test_client.BaseEntityResource):
+         container_req = json.loads(self.responses.last_request.text)
+         self.assertEqual(self.container.name, container_req['name'])
+         self.assertEqual('rsa', container_req['type'])
+-        self.assertItemsEqual(self.container.rsa_secret_refs_json,
++        six.assertCountEqual(self, self.container.rsa_secret_refs_json,
+                               container_req['secret_refs'])
+ 
+     def test_should_store_rsa_via_constructor(self):
+@@ -271,7 +272,7 @@ class 
WhenTestingContainers(test_client.BaseEntityResource):
+         container_req = json.loads(self.responses.last_request.text)
+         self.assertEqual(self.container.name, container_req['name'])
+         self.assertEqual('rsa', container_req['type'])
+-        self.assertItemsEqual(self.container.rsa_secret_refs_json,
++        six.assertCountEqual(self, self.container.rsa_secret_refs_json,
+                               container_req['secret_refs'])
+ 
+     def test_should_get_secret_refs_when_created_using_secret_objects(self):
-- 
2.6.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]