Skip to content

Commit a6a31f0

Browse files
committed
added another test in wksprj_setting to ensure proper behavior when PROJECT specified is not valid for the WORKSPACE
1 parent 71b9312 commit a6a31f0

3 files changed

Lines changed: 23 additions & 8 deletions

File tree

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ Versions
272272
1.2.0
273273
Support for Python 3.5.x
274274
Begin deprecation sequence for pinging the Rally server before the connection attempt,
275-
initially with this version, allow option on instantiation to bypass ping.
275+
initially with this version, allow option on instantiation to bypass ping.
276276
Added ability to rankAbove, rankBelow, rankToTop, rankToBottom for an Artifact.
277277
Fixed defect where user has no default workspace or project.
278278

@@ -286,7 +286,7 @@ Versions
286286
1.1.1
287287
Modified entity.py to allow it to pass back PortfolioItem sub type instances.
288288
Modified rallyresp.py defect referencing non-existing req_type instance var by changing
289-
reference to request_type.
289+
reference to request_type.
290290
Modified restapi.py to use user, dropped auth_user.
291291
Modified restapi.py to be more defensive when user has no associated UserProfile.
292292
Modified context.py to account for use of Cygwin in Pinger code.
@@ -296,7 +296,7 @@ Versions
296296
Modified restapi.py/entity.py to provide rudimentary support for querying of RecycleBin entries.
297297
Modified restapi.py and added search_utils.py to provide a search method for pyral Rally instances.
298298
Modified rallyresp.py to better handle some boundary conditions when response body item counts
299-
differ from what is stated in the TotalResultCount.
299+
differ from what is stated in the TotalResultCount.
300300
Modified context.py to account for scenario where user's default workspace has no projects.
301301
Modified restapi.py/getProject to return correct project.
302302

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
GITHUB_DISTS = '%s/blob/master/dists' % GITHUB_SITE
2222
DOWNLOADABLE_ZIP = '%s/%s-%s.zip' % (GITHUB_DISTS, PACKAGE, VERSION)
2323

24-
MINIMUM_REQUESTS_VERSION = '2.3.0'
24+
MINIMUM_REQUESTS_VERSION = '2.8.1'
2525

2626
setup(name=PACKAGE,
2727
version=VERSION,
@@ -48,6 +48,6 @@
4848
'Topic :: Internet :: WWW/HTTP',
4949
'Topic :: Software Development :: Libraries',
5050
],
51-
#documentation='http://readthedocs.org/docs/pyral'
51+
#documentation='http://pyral.readthedocs.io/en/latest/'
5252
)
5353

test/test_wksprj_setting.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55

66
import py
77

8-
from pyral import Rally
8+
from pyral import Rally, RallyUrlBuilder
99

1010

1111
##################################################################################################
1212

1313
from rally_targets import TRIAL, TRIAL_USER, TRIAL_PSWD
1414
from rally_targets import DEFAULT_WORKSPACE, DEFAULT_PROJECT
15-
from rally_targets import ALTERNATE_WORKSPACE
15+
from rally_targets import ALTERNATE_WORKSPACE, ALTERNATE_PROJECT
1616

1717
##################################################################################################
1818

19-
ALTERNATE_PROJECT = 'Dynamic'
19+
#ALTERNATE_PROJECT = 'Dynamic'
2020

2121
##################################################################################################
2222

@@ -79,6 +79,21 @@ def test_warn_on_setting_invalid_project():
7979
project = rally.getProject()
8080
assert project.Name == DEFAULT_PROJECT
8181

82+
def test_disallow_project_value_invalid_for_workspace():
83+
"""
84+
Using a known valid Rally server and known valid access credentials,
85+
and specifying the default workspace and project that does not exist
86+
in that workspace, issue an Exception that prevents further processing.
87+
"""
88+
problem_text = "No valid Project with the name 'Argonaut' found in the Workspace 'AC WSAPI Toolkit Python'"
89+
with py.test.raises(Exception) as excinfo:
90+
rally = Rally(server=TRIAL, user=TRIAL_USER, password=TRIAL_PSWD,
91+
workspace=DEFAULT_WORKSPACE, project=ALTERNATE_PROJECT, server_ping=False)
92+
actualErrVerbiage = excinfo.value.args[0]
93+
assert excinfo.value.__class__.__name__ == 'RallyRESTAPIError'
94+
assert actualErrVerbiage == problem_text
95+
96+
8297
def test_get_project():
8398
"""
8499
Using a known valid Rally server and known valid access credentials,

0 commit comments

Comments
 (0)