Skip to content

Commit

Permalink
Change test data not to use interanl product info
Browse files Browse the repository at this point in the history
  • Loading branch information
simozhan committed Sep 29, 2015
1 parent 49c136f commit de9f714
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 48 deletions.
6 changes: 3 additions & 3 deletions pdc_client/tests/compose/data/info.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"compose_id": "RHEL-7.0-20130203.7",
"compose_id": "awesome-product-20130203.7",
"compose_date": "2013-02-03",
"compose_type": "nightly",
"compose_respin": 0,
"release": "aifv-5802",
"compose_label": "RC-3.0",
"deleted": false,
"rpm_mapping_template": "https://pdc-dt.app.qa.eng.nay.redhat.com/rest_api/v1/composes/RHEL-7.0-20130203.7/rpm-mapping/{{package}}/",
"rpm_mapping_template": "https://pdc.example.com/rest_api/v1/composes/awesome-product-20130203.7/rpm-mapping/{{package}}/",
"sigkeys": [
"fd431d51"
],
"acceptance_testing": "untested",
"linked_releases": [
"sap-7.0-rhel-7"
"sap-7.0-awesome-product"
],
"rtt_tested_architectures": {
"Workstation": {
Expand Down
6 changes: 3 additions & 3 deletions pdc_client/tests/compose/data/info.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Compose ID RHEL-7.0-20130203.7
Compose ID awesome-product-20130203.7
Compose Label RC-3.0
Compose Date 2013-02-03
Compose Respin 0
Compose Type nightly
Acceptance Testing untested
Deleted False
Release aifv-5802
Rpm Mapping Template https://pdc-dt.app.qa.eng.nay.redhat.com/rest_api/v1/composes/RHEL-7.0-20130203.7/rpm-mapping/{{package}}/
Rpm Mapping Template https://pdc.example.com/rest_api/v1/composes/awesome-product-20130203.7/rpm-mapping/{{package}}/

Linked Releases
Release sap-7.0-rhel-7
Release sap-7.0-awesome-product

Sigkeys
Sigkey fd431d51
Expand Down
46 changes: 23 additions & 23 deletions pdc_client/tests/compose/data/list_multi_page.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
RHEL-7.1-20150924.0
RHEL-7.1-20150924.1
RHEL-7.1-20150924.2
RHEL-7.1-20150924.3
RHEL-7.1-20150924.4
RHEL-7.1-20150924.5
RHEL-7.1-20150924.6
RHEL-7.1-20150924.7
RHEL-7.1-20150924.8
RHEL-7.1-20150924.9
RHEL-7.1-20150924.10
RHEL-7.1-20150924.11
RHEL-7.1-20150924.12
RHEL-7.1-20150924.13
RHEL-7.1-20150924.14
RHEL-7.1-20150924.15
RHEL-7.1-20150924.16
RHEL-7.1-20150924.17
RHEL-7.1-20150924.18
RHEL-7.1-20150924.19
RHEL-7.1-20150924.20
RHEL-7.1-20150924.21
RHEL-7.1-20150924.22
awesome-product-20150924.0
awesome-product-20150924.1
awesome-product-20150924.2
awesome-product-20150924.3
awesome-product-20150924.4
awesome-product-20150924.5
awesome-product-20150924.6
awesome-product-20150924.7
awesome-product-20150924.8
awesome-product-20150924.9
awesome-product-20150924.10
awesome-product-20150924.11
awesome-product-20150924.12
awesome-product-20150924.13
awesome-product-20150924.14
awesome-product-20150924.15
awesome-product-20150924.16
awesome-product-20150924.17
awesome-product-20150924.18
awesome-product-20150924.19
awesome-product-20150924.20
awesome-product-20150924.21
awesome-product-20150924.22
38 changes: 19 additions & 19 deletions pdc_client/tests/compose/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ def setUp(self):
self.runner = Runner()
self.runner.setup()
self.compose_detail = {
"compose_id": "RHEL-7.0-20130203.7",
"compose_id": "awesome-product-20130203.7",
"compose_date": "2013-02-03",
"compose_type": "nightly",
"compose_respin": 0,
"release": "aifv-5802",
"compose_label": "RC-3.0",
"deleted": False,
"rpm_mapping_template": "https://pdc-dt.app.qa.eng.nay.redhat.com/rest_api/v1/composes/RHEL-7.0-20130203.7/rpm-mapping/{{package}}/",
"rpm_mapping_template": "https://pdc.example.com/rest_api/v1/composes/awesome-product-20130203.7/rpm-mapping/{{package}}/",
"sigkeys": [
"fd431d51"
],
"acceptance_testing": "untested",
"linked_releases": [
"sap-7.0-rhel-7"
"sap-7.0-awesome-product"
],
"rtt_tested_architectures": {
"Workstation": {
Expand All @@ -37,7 +37,7 @@ def setUp(self):

def test_list_multi_page(self, api):
api.add_endpoint('composes', 'GET', [
{'compose_id': 'RHEL-7.1-20150924.{}'.format(x)}
{'compose_id': 'awesome-product-20150924.{}'.format(x)}
for x in range(23)
])
with self.expect_output('list_multi_page.txt'):
Expand All @@ -54,45 +54,45 @@ def test_list_deleted(self, api):
[('GET', {'page': 1, 'deleted': True})])

def test_info(self, api):
api.add_endpoint('composes/RHEL-7.0-20130203.7', 'GET', self.compose_detail)
api.add_endpoint('composes/awesome-product-20130203.7', 'GET', self.compose_detail)
with self.expect_output('info.txt'):
self.runner.run(['compose-info', 'RHEL-7.0-20130203.7'])
self.runner.run(['compose-info', 'awesome-product-20130203.7'])
self.assertDictEqual(api.calls,
{'composes/RHEL-7.0-20130203.7': [('GET', {})]})
{'composes/awesome-product-20130203.7': [('GET', {})]})

def test_info_json(self, api):
api.add_endpoint('composes/RHEL-7.0-20130203.7', 'GET', self.compose_detail)
api.add_endpoint('composes/awesome-product-20130203.7', 'GET', self.compose_detail)
with self.expect_output('info.json', parse_json=True):
self.runner.run(['--json', 'compose-info', 'RHEL-7.0-20130203.7'])
self.runner.run(['--json', 'compose-info', 'awesome-product-20130203.7'])
self.assertDictEqual(api.calls,
{'composes/RHEL-7.0-20130203.7': [('GET', {})]})
{'composes/awesome-product-20130203.7': [('GET', {})]})

def test_update(self, api):
api.add_endpoint('composes/RHEL-7.0-20130203.7', 'GET', self.compose_detail)
api.add_endpoint('composes/awesome-product-20130203.7', 'GET', self.compose_detail)
with self.expect_output('info.txt'):
self.runner.run(['compose-update', 'RHEL-7.0-20130203.7',
self.runner.run(['compose-update', 'awesome-product-20130203.7',
'--acceptance-testing', 'passed',
'--linked-releases', 'sap-7.0-rhel-7.0',
'--linked-releases', 'sap-7.0-awesome-product',
'--rtt-tested-architectures', 'Workstation:x86_64:passed'
])
self.assertDictEqual(api.calls, {'composes/RHEL-7.0-20130203.7':
self.assertDictEqual(api.calls, {'composes/awesome-product-20130203.7':
[('PATCH', {'acceptance_testing': 'passed',
'linked_releases': ['sap-7.0-rhel-7.0'],
'linked_releases': ['sap-7.0-awesome-product'],
'rtt_tested_architectures': {'Workstation': {'x86_64': 'passed'}}}),
('GET', {})]})

def test_update_wrong_input1(self, api):
with self.expect_failure():
self.runner.run(['compose-update', 'RHEL-7.0-20130203.7',
self.runner.run(['compose-update', 'awesome-product-20130203.7',
'--acceptance-testing', 'passed',
'--linked-releases', 'sap-7.0-rhel-7.0',
'--linked-releases', 'sap-7.0-awesome-product',
'--rtt-tested-architectures', 'Workstation:x86_64:passed:wronginput'
])

def test_update_wrong_input2(self, api):
with self.expect_failure():
self.runner.run(['compose-update', 'RHEL-7.0-20130203.7',
self.runner.run(['compose-update', 'awesome-product-20130203.7',
'--acceptance-testing', 'wronginput',
'--linked-releases', 'sap-7.0-rhel-7.0',
'--linked-releases', 'sap-7.0-awesome-product',
'--rtt-tested-architectures', 'Workstation:x86_64:passed'
])

0 comments on commit de9f714

Please sign in to comment.