Skip to content

Commit 13672d6

Browse files
committed
fixed 2 sad path tests in test_wksprj_settings
1 parent 3b4ca4c commit 13672d6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/test_wksprj_setting.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ def test_warn_on_setting_invalid_workspace():
5757
rally = Rally(server=RALLY, user=RALLY_USER, password=RALLY_PSWD)
5858
workspace = rally.getWorkspace()
5959
assert workspace.Name == DEFAULT_WORKSPACE
60-
py.test.raises(Exception, "rally.setWorkspace('Constant Misbehavior')")
60+
with py.test.raises(Exception) as exc:
61+
rally.setWorkspace('Constant Misbehavior')
62+
assert 'Specified workspace not valid for your credentials or is in a Closed state' in str(exc)
6163
workspace = rally.getWorkspace()
6264
assert workspace.Name == DEFAULT_WORKSPACE
6365

@@ -72,7 +74,9 @@ def test_warn_on_setting_invalid_project():
7274
rally = Rally(server=RALLY, user=RALLY_USER, password=RALLY_PSWD)
7375
project = rally.getProject()
7476
assert project.Name == DEFAULT_PROJECT
75-
py.test.raises(Exception, "rally.setProject('Thorny Buxcuit Weevilz')")
77+
with py.test.raises(Exception) as exc:
78+
rally.setProject('Thorny Buxcuit Weevilz')
79+
assert 'Specified project not valid for your current workspace or credentials' in str(exc)
7680
project = rally.getProject()
7781
assert project.Name == DEFAULT_PROJECT
7882

0 commit comments

Comments
 (0)