[Python-modules-commits] r28774 - in packages/python-secretstorage/trunk/debian (8 files)

mitya57-guest at users.alioth.debian.org mitya57-guest at users.alioth.debian.org
Sun May 4 07:38:55 UTC 2014


    Date: Sunday, May 4, 2014 @ 07:38:54
  Author: mitya57-guest
Revision: 28774

* Merge from Ubuntu:
  - debian/patches/use_any_collection.diff: Use get_any_collection()
    where possible (upstream patch).
  - Add autopkgtests (LP: #1189172).
* Require gnome-keyring >= 3.11.92 for autopkgtests.

Added:
  packages/python-secretstorage/trunk/debian/patches/
  packages/python-secretstorage/trunk/debian/patches/series
  packages/python-secretstorage/trunk/debian/patches/use_any_collection.diff
  packages/python-secretstorage/trunk/debian/tests/
  packages/python-secretstorage/trunk/debian/tests/control
  packages/python-secretstorage/trunk/debian/tests/gnome-keyring
Modified:
  packages/python-secretstorage/trunk/debian/changelog
  packages/python-secretstorage/trunk/debian/control

Modified: packages/python-secretstorage/trunk/debian/changelog
===================================================================
--- packages/python-secretstorage/trunk/debian/changelog	2014-05-04 07:37:17 UTC (rev 28773)
+++ packages/python-secretstorage/trunk/debian/changelog	2014-05-04 07:38:54 UTC (rev 28774)
@@ -1,3 +1,13 @@
+python-secretstorage (2.0.0-2) UNRELEASED; urgency=medium
+
+  * Merge from Ubuntu:
+    - debian/patches/use_any_collection.diff: Use get_any_collection()
+      where possible (upstream patch).
+    - Add autopkgtests (LP: #1189172).
+  * Require gnome-keyring >= 3.11.92 for autopkgtests.
+
+ -- Dmitry Shachnev <mitya57 at gmail.com>  Sun, 04 May 2014 11:35:18 +0400
+
 python-secretstorage (2.0.0-1) unstable; urgency=medium
 
   * New upstream release.

Modified: packages/python-secretstorage/trunk/debian/control
===================================================================
--- packages/python-secretstorage/trunk/debian/control	2014-05-04 07:37:17 UTC (rev 28773)
+++ packages/python-secretstorage/trunk/debian/control	2014-05-04 07:38:54 UTC (rev 28774)
@@ -16,6 +16,7 @@
 Vcs-Browser: http://anonscm.debian.org/viewvc/python-modules/packages/python-secretstorage/trunk/
 X-Python-Version: >= 2.6
 X-Python3-Version: >= 3.1
+XS-Testsuite: autopkgtest
 
 Package: python-secretstorage
 Architecture: all

Added: packages/python-secretstorage/trunk/debian/patches/series
===================================================================
--- packages/python-secretstorage/trunk/debian/patches/series	                        (rev 0)
+++ packages/python-secretstorage/trunk/debian/patches/series	2014-05-04 07:38:54 UTC (rev 28774)
@@ -0,0 +1 @@
+use_any_collection.diff

Added: packages/python-secretstorage/trunk/debian/patches/use_any_collection.diff
===================================================================
--- packages/python-secretstorage/trunk/debian/patches/use_any_collection.diff	                        (rev 0)
+++ packages/python-secretstorage/trunk/debian/patches/use_any_collection.diff	2014-05-04 07:38:54 UTC (rev 28774)
@@ -0,0 +1,112 @@
+Description: use get_any_collection when possible
+Origin: upstream, commits cbadc121c8da28 and 95b6aafb34b0fc
+Last-Update: 2014-01-29
+
+--- a/secretstorage/__init__.py
++++ b/secretstorage/__init__.py
+@@ -20,6 +20,7 @@
+ from secretstorage.exceptions import SecretStorageException, \
+  SecretServiceNotAvailableException, LockedException, \
+  ItemNotFoundException
++from os.path import join
+ 
+ __version__ = '2.0.0'
+ 
+@@ -57,7 +58,7 @@
+ 	"""Returns tuples for all items in the default collection matching
+ 	`search_attributes`."""
+ 	bus = dbus_init()
+-	collection = Collection(bus)
++	collection = get_any_collection(bus)
+ 	if unlock_all and collection.is_locked():
+ 		collection.unlock()
+ 	search_results = collection.search_items(search_attributes)
+@@ -67,23 +68,23 @@
+ 	"""Returns item id for all items in the default collection matching
+ 	`search_attributes`."""
+ 	bus = dbus_init()
+-	collection = Collection(bus)
++	collection = get_any_collection(bus)
+ 	search_results = collection.search_items(search_attributes)
+ 	return [item._item_id() for item in search_results]
+ 
+ def get_item_attributes(item_id):
+ 	"""Returns item attributes for item with given id."""
+ 	bus = dbus_init()
+-	item = Item(bus, item_id)
++	collection = get_any_collection(bus)
++	item = Item(bus, join(collection.collection_path, str(item_id)))
+ 	return item.get_attributes()
+ 
+ def get_item_object(item_id, unlock=True):
+ 	"""Returns the item with given id and unlocks it if `unlock` is
+ 	`True`."""
+ 	bus = dbus_init()
+-	item = Item(bus, item_id)
+-	collection_path = item.item_path.rsplit('/', 1)[0]
+-	collection = Collection(bus, collection_path)
++	collection = get_any_collection(bus)
++	item = Item(bus, join(collection.collection_path, str(item_id)))
+ 	if unlock and collection.is_locked():
+ 		collection.unlock()
+ 	return item
+@@ -100,7 +101,7 @@
+ 	"""Creates an item with given `label`, `attributes` and `secret` in
+ 	the default collection. Returns id of the created item."""
+ 	bus = dbus_init()
+-	collection = Collection(bus)
++	collection = get_any_collection(bus)
+ 	if unlock and collection.is_locked():
+ 		collection.unlock()
+ 	item = collection.create_item(label, attributes, secret)
+--- a/tests/test_collection.py
++++ b/tests/test_collection.py
+@@ -5,7 +5,7 @@
+ # This file tests the secretstorage.Collection class.
+ 
+ import unittest
+-from secretstorage import dbus_init, Collection, get_all_collections
++from secretstorage import dbus_init, get_any_collection, get_all_collections, Collection
+ 
+ class CollectionTest(unittest.TestCase):
+ 	"""A test case that tests that all common methods of Collection
+@@ -14,7 +14,7 @@
+ 	@classmethod
+ 	def setUpClass(cls):
+ 		cls.bus = dbus_init(main_loop=False)
+-		cls.collection = Collection(cls.bus)
++		cls.collection = get_any_collection(cls.bus)
+ 
+ 	def test_all_collections(self):
+ 		labels = map(Collection.get_label, get_all_collections(self.bus))
+--- a/tests/test_exceptions.py
++++ b/tests/test_exceptions.py
+@@ -15,7 +15,7 @@
+ 	@classmethod
+ 	def setUpClass(cls):
+ 		cls.bus = secretstorage.dbus_init(main_loop=False)
+-		cls.collection = secretstorage.Collection(cls.bus)
++		cls.collection = secretstorage.get_any_collection(cls.bus)
+ 
+ 	def test_double_deleting(self):
+ 		item = self.collection.create_item('MyItem',
+--- a/tests/test_item.py
++++ b/tests/test_item.py
+@@ -6,7 +6,7 @@
+ 
+ import unittest
+ import time
+-from secretstorage import dbus_init, search_items, Collection
++from secretstorage import dbus_init, search_items, get_any_collection
+ 
+ ATTRIBUTES = {'application': 'secretstorage-test', 'attribute': 'qwerty'}
+ NEW_ATTRIBUTES = {'application': 'secretstorage-test',
+@@ -19,7 +19,7 @@
+ 	@classmethod
+ 	def setUpClass(cls):
+ 		cls.bus = dbus_init(main_loop=False)
+-		cls.collection = Collection(cls.bus)
++		cls.collection = get_any_collection(cls.bus)
+ 		cls.created_timestamp = time.time()
+ 		cls.item = cls.collection.create_item('My item', ATTRIBUTES,
+ 			b'pa$$word')

Added: packages/python-secretstorage/trunk/debian/tests/control
===================================================================
--- packages/python-secretstorage/trunk/debian/tests/control	                        (rev 0)
+++ packages/python-secretstorage/trunk/debian/tests/control	2014-05-04 07:38:54 UTC (rev 28774)
@@ -0,0 +1,6 @@
+Tests: gnome-keyring
+Depends: gnome-keyring (>= 3.11.92),
+         python-secretstorage,
+         python3-secretstorage,
+         xauth,
+         xvfb

Added: packages/python-secretstorage/trunk/debian/tests/gnome-keyring
===================================================================
--- packages/python-secretstorage/trunk/debian/tests/gnome-keyring	                        (rev 0)
+++ packages/python-secretstorage/trunk/debian/tests/gnome-keyring	2014-05-04 07:38:54 UTC (rev 28774)
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -eu
+cp -r tests "$ADTTMP"
+cd "$ADTTMP"
+
+export XDG_RUNTIME_DIR="$ADTTMP"
+
+for python in $(pyversions -i) $(py3versions -i); do
+    echo "Testing with $python..."
+    xvfb-run -a $python -m unittest discover -v -s tests
+done


Property changes on: packages/python-secretstorage/trunk/debian/tests/gnome-keyring
___________________________________________________________________
Added: svn:executable
   + *




More information about the Python-modules-commits mailing list