Ejemplo n.º 1
0
 def get_keystore_path():
     """
     This is the Kivy default keystore path.
     """
     keystore_path = os.environ.get('KEYSTORE_PATH')
     if keystore_path is None:
         Controller.patch_keystore_path()
         keystore_path = PyWalib.get_default_keystore_path()
     return keystore_path
Ejemplo n.º 2
0
 def test_get_default_keystore_path(self):
     """
     Checks we the default keystore directory exists or create it.
     Verify the path is correct and that we have read/write access to it.
     """
     keystore_dir = PyWalib.get_default_keystore_path()
     if not os.path.exists(keystore_dir):
         os.makedirs(keystore_dir)
     # checks path correctness
     self.assertTrue(keystore_dir.endswith(".config/pyethapp/keystore/"))
     # checks read/write access
     self.assertEqual(os.access(keystore_dir, os.R_OK), True)
     self.assertEqual(os.access(keystore_dir, os.W_OK), True)