Skip to content

Commit

Permalink
Fix CrossBrowserTesting invalid credentials tests (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
davehunt committed Apr 25, 2017
1 parent 7d70082 commit 1a7468a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions testing/test_crossbrowsertesting.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ def test_invalid_credentials_env(failure, monkeypatch, tmpdir):
monkeypatch.setattr(os.path, 'expanduser', lambda p: str(tmpdir))
monkeypatch.setenv('CROSSBROWSERTESTING_USERNAME', 'foo')
monkeypatch.setenv('CROSSBROWSERTESTING_AUTH_KEY', 'bar')
out = failure()
messages = ['You are not authorized to view this', 'basic auth failed']
out = failure('--capability', 'browser_api_name', 'FF46')
messages = ['User not found!', 'basic auth failed']
assert any(message in out for message in messages)


def test_invalid_credentials_file(failure, monkeypatch, tmpdir):
monkeypatch.setattr(os.path, 'expanduser', lambda p: str(tmpdir))
config = tmpdir.join('.crossbrowsertesting')
config.write('[credentials]\nusername=foo\nkey=bar')
out = failure()
messages = ['You are not authorized to view this', 'basic auth failed']
out = failure('--capability', 'browser_api_name', 'FF46')
messages = ['User not found!', 'basic auth failed']
assert any(message in out for message in messages)

0 comments on commit 1a7468a

Please sign in to comment.