Beispiel #1
0
 def __init__(self, path=DB_PATH):
     self._smm_db_location = get_abs_path(
         path) if path is not None else get_abs_path(DB_DEF_PATH)
     self._smm_db = get_file_name(self._smm_db_location, DB_FILE_NAME)
     self._data = None
     if not check_configuration(self._smm_db):
         create_db_path(self._smm_db_location)
     if not is_file(self._smm_db):
         init_smmdbstore(self._smm_db, INIT_STATE)
     # by now, db is there
     self._data = self._load_json(self._smm_db)
     self._check_data_integrity()
Beispiel #2
0
 def test_check_configuration(self):
     """Check DB path and access rights"""
     self.assertFalse(check_configuration("this_path/should_not_be/valid/but_you/never/know"))
     if os.name.lower() in ("posix", "mac"):
         self.assertTrue(check_configuration("/tmp/"))
Beispiel #3
0
 def test_check_configuration(self):
     """Check DB path and access rights"""
     self.assertFalse(
         check_configuration('this_path/should_not_be/valid/but_you/never/know'))
     if os.name.lower() in ('posix', 'mac'):
         self.assertTrue(check_configuration('/tmp/'))