def test_get_product_config_unknown_product(): context = Context() context.config = { 'products': { 'fenix': {} } } with pytest.raises(TaskVerificationError): _get_product_config(context, 'unknown')
def test_get_product_config(): context = Context() context.config = {"products": [{"product_names": ["fenix"], "foo": "bar"}]} assert _get_product_config(context, "fenix") == { "product_names": ["fenix"], "foo": "bar" }
def test_get_product_config(): context = Context() context.config = { 'products': { 'fenix': { 'foo': 'bar' } } } assert _get_product_config(context, 'fenix') == {'foo': 'bar'}
def test_get_product_config(): context = Context() context.config = { 'products': [{ 'product_names': ['fenix'], 'foo': 'bar', }] } assert _get_product_config(context, 'fenix') == { 'product_names': ['fenix'], 'foo': 'bar' }
def test_get_product_config_validation(): context = Context() context.config = {} with pytest.raises(ConfigValidationError): _get_product_config(context, 'fenix')
def test_get_product_config_unknown_product(): context = Context() context.config = {"products": [{"product_names": ["fenix"]}]} with pytest.raises(TaskVerificationError): _get_product_config(context, "unknown")