diff --git a/endpoints/test.py b/endpoints/test.py index 1308a6b46..0ebd953ed 100644 --- a/endpoints/test.py +++ b/endpoints/test.py @@ -37,7 +37,7 @@ def generate_fake_status(): 'complete': {}, 'building': { 'total_commands': 7, - 'current_command': random.randint(1, 7), + 'current_command': random.randint(1, 7), }, 'pushing': { 'total_commands': 7, @@ -97,11 +97,24 @@ def get_fake_repo_build_logs(): adv_total = 110 lorem_logs = get_sentences(10) + def wrap_log_message(rand, msg): + if rand.randint(1, 10) == 1: + block = { + 'is_command': True, + 'message': 'Step %s : %s' % (rand.randint(1, 10), msg) + } + else: + block = { + 'message': msg, + } + return block + + rnd = SystemRandom() return jsonify({ 'start': adv_start, 'end': adv_end, 'total': adv_total, - 'logs': [{'message': sentence} for sentence in lorem_logs] + 'logs': [wrap_log_message(rnd, sentence) for sentence in lorem_logs] })