def test_telnet_all_values(self,log): db = database.Database() db.create_default_database() validator = datavalidator.DataValidator() Table_Insert.prepare_data_for_insertion(validator.get_schema(), self.telnet_data) connection = sqlite3.connect(self.gci['Database']['path']) cursor = connection.cursor() row = cursor.execute('select * from test_telnet;').fetchall()[0] check_list = self.helper_get_values_out(self.telnet_data) self.assertTrue(set(row) > set(check_list)) shutil.rmtree(os.getcwd() + self.test_db_dir)
def run(self): """ This will insert all data in the queue and then once finished give up control of the condition variable """ while not self.kill: self.condition.acquire() if self.q.check_empty(): self.condition.wait() while not self.q.check_empty(): value = self.q.get_next_item() Table_Insert.prepare_data_for_insertion( self.q.dv.table_schema, value) self.condition.notify() self.condition.release()