def test_rpms_not_found(self, mock_get_koji_session): mock_get_koji_session.return_value.listRPMs.return_value = [] build = 'fake-build-1.0-1.el6' with pytest.raises(ProductListingsNotFoundError) as excinfo: getProductListings('fake-label', build) assert "Could not find any RPMs for build: {}".format(build) == str( excinfo.value)
def getProductListings(*a, **kw): try: return products.getProductListings(*a, **kw) except Exception: utils.log_remote_call_error('XMLRPC call getProductListings() failed', *a, **kw) raise Fault(1, 'An unexpected error has occurred.')
def get(self, label, build_info): try: return products.getProductListings(label, build_info) except Exception: utils.log_remote_call_error('API call getProductListings() failed', label, build_info) raise
def get(self, label, build_info): try: return products.getProductListings(label, build_info) except products.ProductListingsNotFoundError as ex: raise NotFound(str(ex)) except Exception: utils.log_remote_call_error('API call getProductListings() failed', label, build_info) raise
def test_simple(self): label = 'RHEL-6-Server-EXTRAS-6' build = 'dumb-init-1.2.0-1.20170802gitd283f8a.el6' result = getProductListings(label, build) expected = \ {'EXTRAS-6': {'dumb-init-1.2.0-1.20170802gitd283f8a.el6': {'src': ['x86_64'], 'x86_64': ['x86_64']}, 'dumb-init-debuginfo-1.2.0-1.20170802gitd283f8a.el6': {'x86_64': ['x86_64']}, } } assert result == expected
def test_simple(self, app): label = "RHEL-6-Server-EXTRAS-6" build = "dumb-init-1.2.0-1.20170802gitd283f8a.el6" result = getProductListings(label, build) expected = { "EXTRAS-6": { "dumb-init-1.2.0-1.20170802gitd283f8a.el6": { "src": ["x86_64"], "x86_64": ["x86_64"], }, "dumb-init-debuginfo-1.2.0-1.20170802gitd283f8a.el6": { "x86_64": ["x86_64"] }, } } assert result == expected