Hello community,

here is the log from the commit of package python-keyring for openSUSE:Factory 
checked in at 2020-10-02 17:15:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-keyring (Old)
 and      /work/SRC/openSUSE:Factory/.python-keyring.new.4249 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-keyring"

Fri Oct  2 17:15:31 2020 rev:38 rq:838815 version:21.2.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-keyring/python-keyring.changes    
2020-06-05 19:59:45.831845216 +0200
+++ /work/SRC/openSUSE:Factory/.python-keyring.new.4249/python-keyring.changes  
2020-10-02 17:15:35.942078324 +0200
@@ -1,0 +2,10 @@
+Wed Sep 30 12:35:11 UTC 2020 - Hans-Peter Jansen <h...@urpla.net>
+
+- Fold -tests package into mail package again
+
+-------------------------------------------------------------------
+Mon Sep 21 16:25:13 UTC 2020 - Hans-Peter Jansen <h...@urpla.net>
+
+- Apply fix-kwallet-tests.patch
+
+-------------------------------------------------------------------
@@ -20,0 +31,5 @@
+Sat May  2 17:54:41 UTC 2020 - Hans-Peter Jansen <h...@urpla.net>
+
+- fix packaging tests
+
+-------------------------------------------------------------------
@@ -94,0 +110,7 @@
+
+-------------------------------------------------------------------
+Sat Mar  2 10:41:01 UTC 2019 - Hans-Peter Jansen <h...@urpla.net>
+
+- Package tests in separate package $flavor-tests
+  Allows packages, that depend on these tests, to build successfully
+  e.g. keyrings.cryptfile

New:
----
  fix-kwallet-tests.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-keyring.spec ++++++
--- /var/tmp/diff_new_pack.zlLith/_old  2020-10-02 17:15:36.906078873 +0200
+++ /var/tmp/diff_new_pack.zlLith/_new  2020-10-02 17:15:36.910078876 +0200
@@ -23,8 +23,10 @@
 Release:        0
 Summary:        System keyring service access from Python
 License:        Python-2.0 AND MIT
+Group:          Development/Languages/Python
 URL:            https://github.com/jaraco/keyring
 Source:         
https://files.pythonhosted.org/packages/source/k/keyring/keyring-%{version}.tar.gz
+Patch:          fix-kwallet-tests.patch
 BuildRequires:  %{python_module SecretStorage >= 3}
 BuildRequires:  %{python_module entrypoints}
 BuildRequires:  %{python_module importlib-metadata}
@@ -50,6 +52,7 @@
 
 %prep
 %setup -q -n keyring-%{version}
+%patch -p1
 # For rpmlint warning: remove shebang from python library:
 sed -i '/^#!/d' keyring/cli.py
 sed -i -e 's,--flake8,,' -e 's,--black,,' -e 's,--cov,,' pytest.ini

++++++ fix-kwallet-tests.patch ++++++
diff --git a/tests/backends/test_kwallet.py b/tests/backends/test_kwallet.py
index 68cb4c7..f2d1638 100644
--- a/tests/backends/test_kwallet.py
+++ b/tests/backends/test_kwallet.py
@@ -6,6 +6,7 @@ from keyring.testing.backend import BackendBasicTests
 
 @pytest.mark.skipif(not kwallet.DBusKeyring.viable, reason="KWallet5 
unavailable")
 class TestDBusKWallet(BackendBasicTests):
+    __test__ = True
 
     # Remove '@' from service name as this is not supported in service names
     # '@' will cause troubles during migration of kwallet entries
@@ -14,66 +15,27 @@ class TestDBusKWallet(BackendBasicTests):
     def init_keyring(self):
         return kwallet.DBusKeyring()
 
-    def cleanup(self):
-        for item in self.credentials_created:
-            # Suppress errors, as only one pre/post migration item will be
-            # present
-            try:
-                self.keyring.delete_password(*item)
-            except BaseException:
-                pass
-
-        # TODO Remove empty folders created during tests
-
-    def set_password(self, service, username, password, old_format=False):
-        # set the password and save the result so the test runner can clean
-        #  up after if necessary.
-        self.credentials_created.add((service, username))
-
-        if old_format:
-            username = username + '@' + service
-            service = 'Python'
-
-        super().set_password(service, username, password)
-
-    def check_set_get(self, service, username, password):
+    def test_credential(self):
         keyring = self.keyring
 
-        # for the non-existent password
-        self.assertEqual(keyring.get_password(service, username), None)
+        # not supported from kwallets
+        #cred = keyring.get_credential('service', None)
+        #assert cred is None
 
-        # common usage
-        self.set_password(service, username, password, True)
-        # re-init keyring to force migration
-        self.keyring = keyring = self.init_keyring()
-        ret_password = keyring.get_password(service, username)
-        self.assertEqual(
-            ret_password,
-            password,
-            "Incorrect password for username: '%s' "
-            "on service: '%s'. '%s' != '%s'"
-            % (service, username, ret_password, password),
-        )
+        self.set_password('service1', 'user1', 'password1')
+        self.set_password('service1', 'user2', 'password2')
 
-        # for the empty password
-        self.set_password(service, username, "", True)
-        # re-init keyring to force migration
-        self.keyring = keyring = self.init_keyring()
-        ret_password = keyring.get_password(service, username)
-        self.assertEqual(
-            ret_password,
-            "",
-            "Incorrect password for username: '%s' "
-            "on service: '%s'. '%s' != '%s'" % (service, username, 
ret_password, ""),
+        cred = keyring.get_credential('service1', None)
+        assert cred is None or (cred.username, cred.password) in (
+            ('user1', 'password1'),
+            ('user2', 'password2'),
         )
-        ret_password = keyring.get_password('Python', username + '@' + service)
-        self.assertEqual(
-            ret_password,
-            None,
-            "Not 'None' password returned for username: '%s' "
-            "on service: '%s'. '%s' != '%s'. Passwords from old "
-            "folder should be deleted during migration."
-            % (service, username, ret_password, None),
+
+        cred = keyring.get_credential('service1', 'user2')
+        assert cred is not None
+        assert (cred.username, cred.password) in (
+            ('user1', 'password1'),
+            ('user2', 'password2'),
         )
 
 

Reply via email to