Skip to content

Commit ceb299f

Browse files
klehman-rallykiplin.lehman@broadcom.com
andauthored
match klehman-rally/pyral master (#192)
* working on getting in and between query conditions working when there are other conditions * fixed multi condition query where subset and / or range condition(s) are involved * README and doco inclusion * generated stuff for 1.5.2 * final generated elements for this 1.5.2 release * incorp typo fix Revison to Revision in entity.py from Yevgen Lasman * more work on quasi-hackathon project of release_start_items.py * fixed getting current feature state values in the idenfityVariance... function * first complete good run for inception, current an d variance. extra print on variance items where Name or State/ScheduleState not set for troubleshooting purposes * minor mods, restapi.py mod to not assume last element of _ref is on ObjectID int value * minor adjustments to test_allowed_values.py, pyral/context.py and examples/periscope.py * updated to 1.6.0 * adjusted test for query of PR to retrieve a more selective set * updated string construction on a few modules to be mostly f-string * updated test_pull_request_copied.py * fixed WS_VER to have ending slash * minor change in restapi.py to get rid of some commented out lines, update the README.rst changes section * Added Objective, KeyResult, Risk and CapacityPlan* entities to entity.py. Fixed restapi.py Rally.getAllUsers method. search is no longer supported by the WSAPI. systematic replacement of string formatting with use of f-string constructs. Updated explicit support for Python 3.9, 3.10 and 3.11 * release candidate 1 for 1.6.0 release * update README.rst to include mention of supporting 3.12 * fixed stray specific value for example * small mod to README.rst --------- Co-authored-by: kiplin.lehman@broadcom.com <kiplin.lehman@broadcom.com>
1 parent 8fbaaf5 commit ceb299f

7 files changed

Lines changed: 82 additions & 1 deletion

File tree

dist/pyral-1.6.0.docs.html.zip

2.68 MB
Binary file not shown.

dist/pyral-1.6.0.tar.gz

7.98 MB
Binary file not shown.

dists/pyral-1.6.0.tar.gz

7.98 MB
Binary file not shown.

dists/pyral-1.6.0.zip

2.8 MB
Binary file not shown.
2.68 MB
Binary file not shown.

examples/get_attachments.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ def main(args):
3434
options = [opt for opt in args if opt.startswith('--')]
3535
args = [arg for arg in args if arg not in options]
3636
server, username, password, apikey, workspace, project = rallyWorkset(options)
37-
print " | ".join([server, username, password, workspace, project])
37+
#####
38+
workspace = 'Alligators WRK Unigrations Core'
39+
project = 'Dynamic'
40+
#####
41+
print(" | ".join([server, username, password, workspace, project]))
3842
if apikey:
3943
rally = Rally(server, apikey=apikey, workspace=workspace, project=project)
4044
else:
@@ -74,6 +78,7 @@ def main(args):
7478
errout('WARNING: more than 1 item returned matching your criteria\n')
7579

7680
artifact = response.next()
81+
7782
attachments = rally.getAttachments(artifact)
7883
for attachment in attachments:
7984
print("-" * 32)

test/test_proxy.py

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#!/usr/bin/env python
2+
3+
import sys, os
4+
import types
5+
import py
6+
import pytest
7+
import time
8+
import re
9+
10+
import pyral
11+
from pyral import Rally
12+
13+
RallyRESTAPIError = pyral.context.RallyRESTAPIError
14+
RallyResponseError = pyral.rallyresp.RallyResponseError
15+
16+
##################################################################################################
17+
18+
from rally_targets import RALLY, RALLY_USER, RALLY_PSWD #, HTTPS_PROXY
19+
from rally_targets import PROD, APIKEY
20+
from rally_targets import PROD_USER, PROD_PSWD
21+
22+
HTTPS_PROXY = 'localhost:8899'
23+
24+
##################################################################################################
25+
26+
def test_basic_connection():
27+
"""
28+
Using a known valid Rally server and access credentials, issue a simple query
29+
request against a known valid Rally entity.
30+
"""
31+
rally = Rally(server=RALLY, user=RALLY_USER, password=RALLY_PSWD)
32+
response = rally.get('Project', fetch=False, limit=10)
33+
assert response != None
34+
assert response.status_code == 200
35+
time.sleep(1)
36+
37+
def test_basic_proxied_connection():
38+
"""
39+
Using a known valid Rally server and access credentials, issue a simple query
40+
request against a known valid Rally entity via use of https_proxy.
41+
"""
42+
os.environ['https_proxy'] = "http://%s" % HTTPS_PROXY
43+
44+
rally = Rally(server=RALLY, user=RALLY_USER, password=RALLY_PSWD)
45+
response = rally.get('Project', fetch=False, limit=10)
46+
assert response != None
47+
assert response.status_code == 200
48+
49+
os.environ['https_proxy'] = ""
50+
del os.environ['https_proxy']
51+
time.sleep(1)
52+
53+
#def test_connection_proxy_with_api_key():
54+
# """
55+
# Using a known valid Rally server and access credentials, issue a simple query
56+
# request against a known valid Rally entity via use of https_proxy.
57+
# """
58+
# os.environ['https_proxy'] = "http://%s" % HTTPS_PROXY
59+
#
60+
# rally = Rally(server=RALLY, apikey=API_KEY)
61+
# rally.setWorkspace('Rally')
62+
# projects = rally.getProjects()
63+
# project_names = sorted([proj.Name for proj in projects])
64+
# AWESOME_PROJECT = 'Alligator Tiers'
65+
# assert AWESOME_PROJECT in project_names
66+
# response = rally.get('Project', fetch=False, limit=10)
67+
# assert response != None
68+
# assert response.status_code == 200
69+
# rally.setProject(AWESOME_PROJECT)
70+
# project = rally.getProject()
71+
# assert project.Name == AWESOME_PROJECT
72+
73+
74+
75+
##########################################################################################
76+

0 commit comments

Comments
 (0)