def getProductInfo(*a, **kw): try: return products.getProductInfo(*a, **kw) except Exception: utils.log_remote_call_error('XMLRPC call getProductInfo() failed', *a, **kw) raise Fault(1, 'An unexpected error has occurred.')
def get(self, label): try: versions, variants = products.getProductInfo(label) except Exception: utils.log_remote_call_error('API call getProductInfo() failed', label) raise return [versions, variants]
def get(self, label): try: versions, variants = products.getProductInfo(label) except products.ProductListingsNotFoundError as ex: raise NotFound(str(ex)) except Exception: utils.log_remote_call_error('API call getProductInfo() failed', label) raise return [versions, variants]
def test_getProductInfo(self, mock_get_product_info): label = 'Fake-label' getProductInfo(label) mock_get_product_info.assert_called_once_with(label)
def test_simple(self): label = 'RHEL-6-Server-EXTRAS-6' result = getProductInfo(label) assert result == ('6.9', ['EXTRAS-6'])
def test_simple(self, app): label = "RHEL-6-Server-EXTRAS-6" result = getProductInfo(label) assert result == ("6.9", ["EXTRAS-6"])