Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: tests/test_xtm_translate.py

Issue 29968558: Issue 7037 - [XTM Integration] Make REST API url customizable
Patch Set: Created Dec. 27, 2018, 2:23 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/test_xtm_translate.py
diff --git a/tests/test_xtm_translate.py b/tests/test_xtm_translate.py
index c0eb51cc0a877836a7145568efc069a308020d65..1312ba040d8eaa724b03e4d8a1b8f8492f827485 100644
--- a/tests/test_xtm_translate.py
+++ b/tests/test_xtm_translate.py
@@ -64,7 +64,7 @@ def env_valid_token():
@pytest.mark.script_launch_mode('subprocess')
@pytest.mark.parametrize('args,exp_msg', [
- (['-h'], 'usage: xtm_translations.py [-h] [-v] '
+ (['-h'], 'usage: xtm_translations.py [-h] [-v] [--api-urlAPI_URL]'
'{login,create,upload,download} ...'),
(['create', '-h'], 'usage: xtm_translations.py create [-h] --name NAME '
'--desc DESC --client-id CLIENT_ID --ref-id REF_ID '
@@ -172,7 +172,7 @@ def test_login(intercept, monkeypatch, capsys):
)
monkeypatch.setattr('getpass.getpass', lambda prompt: 'pass')
- generate_token(None)
+ generate_token(XtmMockArgs.LoginArgsNamespace)
out, err = capsys.readouterr()
assert err == ''
@@ -188,7 +188,7 @@ def test_login_wrong_credentials(intercept, monkeypatch, capsys):
monkeypatch.setattr('getpass.getpass', lambda prompt: 'pass')
monkeypatch.setattr('sys.exit', lambda x: sys.stderr.write(str(x)))
- generate_token(None)
+ generate_token(XtmMockArgs.LoginArgsNamespace)
out, err = capsys.readouterr()
assert 'Invalid credentials' in err

Powered by Google App Engine
This is Rietveld