def test_get_time_to_end_stream(self): eternal_process = EternalProcess() now = datetime.datetime.now() now_plus_10 = now + datetime.timedelta(minutes=10) now_plus_10 = now_plus_10.strftime('%H:%M') self.assertEqual(now_plus_10, eternal_process.get_time_to_end_stream(10))
def test_is_time_to_get_game_data_for_day(self): eternal_process = EternalProcess() eternal_process.time_to_check_games_for_the_day = datetime.datetime.now( ).strftime('%H:%M') self.assertEqual(True, eternal_process.is_time_to_get_game_data_for_day()) eternal_process.time_to_check_games_for_the_day = '04:14' self.assertEqual(False, eternal_process.is_time_to_get_game_data_for_day())
def test_get_write_path_for_days_games(self): eternal_process = EternalProcess() base = os.getcwd() + '/Twitter_Utils/data/daily-logs/' end = datetime.datetime.now().strftime('%Y-%m-%d') + '.json' self.assertEqual(base + end, eternal_process.get_write_path_for_days_games())
def setUp(self): self.eternalProcess = EternalProcess() self.stream_list = [] self.end_times_list = [] self.time_to_check_games_for_the_day = '09:30' self.data_gatherer = DataGatherer()