import unittest from os import path import time_recoder.time_recoder_config as config_ import re from time import sleep from time_recoder.save_recorded_time_in_table import save_recorded_time_in_table, get_current_time_as_timestamp from time_recoder.time_recoder_config import TEST_CASE class ConfigTest(unittest.TestCase): def test_path_folder_exists(self): folder_string_index = config_.PATH.rfind('\\') tested_path = config_.PATH[0:folder_string_index] self.assertTrue(path.isdir(tested_path), msg='The Folder where the Table should be does not exist, check path') class TimeRecorderIntegrationtest(unittest.TestCase): def test_time_recorder_without_gui(self): ConfigTest().test_path_folder_exists() # Integration Test start_time = get_current_time_as_timestamp() sleep(5) worked_time_in_minutes = (get_current_time_as_timestamp() - start_time) / 60 save_recorded_time_in_table(worked_time_in_minutes, 'default') class GUITest(unittest.TestCase): def test_gui_layout_format(self): raise NotImplementedError if __name__ == '__main__': TimeRecorderIntegrationtest().test_time_recorder_without_gui()