Jason R. Coombs avatar Jason R. Coombs committed 046aafe

Stripped test_supported_no_module down to its essential test.

Comments (0)

Files changed (1)


 from ..py30compat import unittest
 from ..test_backend import BackendBasicTests
 from keyring.backends import SecretService
-from ..util import ImportKiller, Environ
+from ..util import ImportKiller
 def is_dbus_supported():
 class SecretServiceKeyringTestCase(BackendBasicTests, unittest.TestCase):
     __test__ = True
-    def environ(self):
-        return dict(DISPLAY='1',
-                    DBUS_SESSION_BUS_ADDRESS='1')
     def init_keyring(self):
         print >> sys.stderr, "Testing SecretServiceKeyring, following password prompts are for this keyring"
         return SecretService.Keyring()
+class SecretServiceKeyringUnitTests(unittest.TestCase):
     def test_supported_no_module(self):
+        """
+        SecretService Keyring is not supported if dbus can't be imported.
+        """
         with ImportKiller('dbus'):
-            with Environ(**self.environ()):
-                self.assertEqual(-1, self.keyring.supported())
+            self.assertEqual(-1, SecretService.Keyring().supported())
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.