def test_random_commit_message(self): for _ in xrange(random.randint(10, 20)): pool = list(string.printable) random.shuffle(pool) message = ''.join(pool)[:random.randint(0, len(string.printable))] expected_output = None assert parse_commit_message(message) == expected_output
def test_empty_message_body(self): service_name = 'example-service' tag = '0b5fb3e5-c91d-45f1-8c6e-5ceeaa11ec8f' env = 'test-environment' message = 'chore(tfvars): bump %s#%s "%s"' % ( service_name, tag, env, ) expected_output = None assert parse_commit_message(message) == expected_output
def test_message_with_committed_by_no_email(self): author_name = 'David Vuong' author_email = None service_name = 'example-service' tag = '0b5fb3e5-c91d-45f1-8c6e-5ceeaa11ec8f' env = 'test-environment' message = '\n'.join([ 'chore(tfvars): bump %s#%s "%s"' % ( service_name, tag, env, ), '\n' 'committed-by: %s' % (author_name, ), ]) expected_output = { 'author_name': author_name, 'author_email': author_email, } assert parse_commit_message(message) == expected_output
def test_empty_commit(self): message = '' expected_output = None assert parse_commit_message(message) == expected_output