filledLength = int(length * iteration // total) bar = fill * filledLength + '-' * (length - filledLength) print(f'\r{prefix} |{bar}| {percent}% {suffix}', end=printEnd, flush=True) # Print New Line on Complete if iteration == total: print(flush=True) if __name__ == '__main__': if len(sys.argv) != 3: print("Usage : python avc_analyser.py DEVICE_ID SCENARIO") exit(2) device = sys.argv[1] scenario_file = sys.argv[2] scenario = get_scenario(scenario_file) if scenario is None or check_scenario_keys(scenario) is False: print('Something goes wrong with scenario file') exit(2) bearer = get_bearer('bearer.txt') if bearer is None: print('Something goes wrong with bearer file') exit(2) log = get_log(device, bearer) if log is None: print('Something goes wrong with app to get log') exit(2) start_point = get_start(log)
def test_get_scenario_file_not_found(self): scenario = get_scenario('no_file.json') self.assertIsNone(scenario)
def test_get_scenario_good_keys(self): scenario = get_scenario('../scenario.json') self.assertTrue(check_scenario_keys(scenario))
def test_get_scenario_bad_keys(self): scenario = get_scenario('ressources/bad_keys.json') self.assertFalse(check_scenario_keys(scenario))
def test_get_scenario_bad_json(self): scenario = get_scenario('ressources/lorem_ipsum.txt') self.assertIsNone(scenario)
def test_get_scenario_file_found(self): scenario = get_scenario('../scenario.json') self.assertIsNotNone(scenario)