コード例 #1
0
 def test_not_found(self, client):
     client.adapter.register_uri(
         'GET',
         PROD + '/api/v1/releases?filter%5Bname%5D=missing-release-1.0',
         json={'data': []})
     result = get_release(client, 'missing-release-1.0')
     assert result is None
コード例 #2
0
 def test_simple(self, client):
     client.adapter.register_uri(
         'GET',
         PROD + '/api/v1/releases?filter%5Bname%5D=rhceph-4.0',
         json=RELEASE)
     result = get_release(client, 'rhceph-4.0')
     expected = {
         'id': 1017,
         'name': 'rhceph-4.0',
         'description': 'Red Hat Ceph Storage 4.0',
         'type': 'QuarterlyUpdate',
         'allow_pkg_dupes': True,
         'ship_date': '2020-01-31',
         'pelc_product_version_name': '',
         'active': True,
         'enabled': True,
         'enable_batching': False,
         'is_async': False,
         'is_deferred': False,
         'allow_shadow': False,
         'allow_blocker': False,
         'allow_exception': False,
         'limit_bugs_by_product': False,
         'supports_component_acl': True,
         'blocker_flags': ['ceph-4'],
         'internal_target_release': '',
         'zstream_target_release': None,
         'product': 'RHCEPH',
         'program_manager': '*****@*****.**',
         'state_machine_rule_set': None,
         'brew_tags': [],
         'product_versions': ['RHCEPH-4.0-RHEL-8', 'RHEL-7-RHCEPH-4.0'],
     }
     assert result == expected
コード例 #3
0
 def test_plus_character_in_name(self, client):
     """ Quote "+" characters in release name HTTP request """
     json = load_json('rhel-8.4.0.z+eus.release.json')
     client.adapter.register_uri(
         'GET',
         PROD + '/api/v1/releases?filter%5Bname%5D=RHEL-8.4.0.Z.MAIN%2BEUS',
         json=json)
     result = get_release(client, 'RHEL-8.4.0.Z.MAIN+EUS')
     assert result['name'] == 'RHEL-8.4.0.Z.MAIN+EUS'
コード例 #4
0
 def test_null_relationship(self, client, relationship):
     """ Some relationships might be null. Exercise these code paths """
     json = deepcopy(RELEASE)
     json['data'][0]['relationships'][relationship] = None
     client.adapter.register_uri(
         'GET',
         PROD + '/api/v1/releases?filter%5Bname%5D=rhceph-4.0',
         json=json)
     result = get_release(client, 'rhceph-4.0')
     assert result[relationship] is None