def setUp(self):
     self.nonexistent_db_filepath = getTestFileName("nonexistent_sqlite_file")
     try:
         os.remove(self.nonexistent_db_filepath)
     except:
         pass
     self.nonexistent_db = Datafile(self.nonexistent_db_filepath, debug=True)
Example #2
0
 def setUp(self):
     self.multitable_db_filepath = getTestFileName(
         'four_tables_cnx_metadata')
     self.multitable_db = Datafile(self.multitable_db_filepath, debug=True)
     self.tables = getTestFileTables('four_tables_cnx_metadata')
     if len(self.tables) <= 1:
         raise Exception('Bad test db setup -- should contain >1 tables')
Example #3
0
 def testGetTableNames(self):
     for datafile in self.datafiles:
         # create temp db connection
         db = Datafile(getTestFileName(datafile))
         db.openConnection()
         # generate expected/actual results
         expected = getTestFileTables(datafile)
         actual = db.getTableNames()
         # close db connection
         db.closeConnection()
         # assert table names match
         self.assertCountEqual(expected, actual)
 def setUp(self):
     self.invalid_db_filepath = getTestFileName("invalid_sqlite_file")
     self.invalid_db = Datafile(self.invalid_db_filepath, debug=True)
 def setUp(self):
     path = getTestFileName('test_python_package')
     self.script_relative_filepath = path
     self.script_absolute_filepath = os.path.abspath(path)
Example #6
0
 def setUp(self):
     self.onetable_db_filepath = getTestFileName('single_simple_table')
     with Datafile(self.onetable_db_filepath, debug=True) as db:
         self.data = db.getData()
Example #7
0
 def setUp(self):
     self.zerotable_db_filepath = getTestFileName('zero_tables')
     self.zerotable_db = Datafile(self.zerotable_db_filepath, debug=True)
     self.tables = getTestFileTables('zero_tables')
     if len(self.tables) != 0:
         raise Exception('Bad test db setup -- should contain 0 tables')
Example #8
0
 def setUp(self):
     self.onetable_db_filepath = getTestFileName('single_simple_table')
     self.onetable_db = Datafile(self.onetable_db_filepath, debug=True)
     self.tables = getTestFileTables('single_simple_table')
     if len(self.tables) != 1:
         raise Exception('Bad test db setup -- should only contain 1 table')
Example #9
0
 def setUp(self):
     self.existing_db_filepath = getTestFileName('single_simple_table')
     self.existing_db = Datafile(self.existing_db_filepath)
 def setUp(self):
     file = getTestFileName("no_input_data_config")
     self.data = CachedData(file)
 def setUp(self):
     config_filepath = getTestFileName("config_valid_2")
     self.data = CachedData(config_filepath)
Example #12
0
 def setUp(self):
     self.existing_db_filepath = getTestFileName('single_simple_table')
     self.existing_db = Datafile(self.existing_db_filepath, debug=True)
     self.existing_db.openConnection()