Skip to content

Commit

Permalink
Merge pull request #25 from jeremybanks/nicer-test-message
Browse files Browse the repository at this point in the history
Include a link to the current commit in the test message
  • Loading branch information
Manishearth committed Apr 29, 2014
2 parents 02db5f5 + f1b8f5a commit 45ef2a0
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions test/test_live_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,22 @@
('SE', '11540'), # Charcoal HQ
]


if (os.environ.get('TRAVIS_BUILD_ID') and
os.environ.get('TRAVIS_REPO_SLUG')):
TEST_MESSAGE_PREFIX = (
os.environ.get('TRAVIS_REPO_SLUG') and
os.environ.get('TRAVIS_COMMIT')):
TEST_MESSAGE_FORMAT = (
"[ [ChatExchange@Travis](https://travis-ci.org/"
"{0[TRAVIS_REPO_SLUG]}/builds/{0[TRAVIS_BUILD_ID]}) ] "
).format(os.environ)
"{0[TRAVIS_REPO_SLUG]}/builds/{0[TRAVIS_BUILD_ID]} \"This is "
"a test message for ChatExchange using the nonce {{0}}.\") ] "
"This is a test of [{0[TRAVIS_REPO_SLUG]}@{short_commit}]("
"https://github.com/{0[TRAVIS_REPO_SLUG]}/commit/{0[TRAVIS_COMMIT]})."
).format(os.environ, short_commit=os.environ['TRAVIS_COMMIT'][:8])
else:
TEST_MESSAGE_PREFIX = (
"[ [ChatExchange@localhost](https://github.com/Manishearth/ChatExchange/) ] ")
TEST_MESSAGE_FORMAT = (
"[ [ChatExchange@localhost](https://github.com/Manishearth/"
"ChatExchange/ \"This is a test message for ChatExchange using "
"the nonce {0}.\") ] This is a test message for ChatExchange.")



Expand All @@ -44,11 +51,7 @@ def test_se_message_echo(host_id, room_id):
live_testing.password)

test_message_nonce = uuid.uuid4().hex
test_message = (
"%s This is a test message [for ChatExchange]("
"https://github.com/Manishearth/ChatExchange \"This is a "
"ChatExchange test message with the nonce %s.\")."
% (TEST_MESSAGE_PREFIX, test_message_nonce))
test_message = TEST_MESSAGE_FORMAT.format(test_message_nonce)

replied = [False]

Expand Down

0 comments on commit 45ef2a0

Please sign in to comment.