Commits

Jason R. Coombs committed 046aafe

Stripped test_supported_no_module down to its essential test.

Comments (0)

Files changed (1)

keyring/tests/backends/test_SecretService.py

 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():
     try:
 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())