def test_get_artman_config_filenames_list_exception(): api_config_patterns = ['test/cli/data/gapic/api/artman_${API_SHORT_NAME}.yaml', 'test/cli/data/gapic/core/artman_${API_SHORT_NAME}.yaml'] exclude_apis = [ 'test/cli/data/gapic/api/artman_longrunning.yaml', ] with pytest.raises(ValueError): batch_generation._get_artman_config_filenames( api_config_patterns, ['longrunning'], exclude_apis)
def test_get_artman_config_filenames_list_exception(): api_config_patterns = [ 'test/cli/data/gapic/api/artman_${API_SHORT_NAME}.yaml', 'test/cli/data/gapic/core/artman_${API_SHORT_NAME}.yaml' ] exclude_apis = [ 'test/cli/data/gapic/api/artman_longrunning.yaml', ] with pytest.raises(ValueError): batch_generation._get_artman_config_filenames(api_config_patterns, ['longrunning'], exclude_apis)
def test_get_artman_config_filenames_list(): api_config_patterns = ['test/cli/data/gapic/api/artman_${API_SHORT_NAME}.yaml', 'test/cli/data/gapic/core/artman_${API_SHORT_NAME}.yaml'] expected = [ 'test/cli/data/gapic/api/artman_logging.yaml', 'test/cli/data/gapic/api/artman_longrunning.yaml', ] actual = batch_generation._get_artman_config_filenames( api_config_patterns, ['logging', 'longrunning'], []) assert expected == actual
def test_get_artman_config_filenames_comma_separated(): api_config_patterns = ['test/cli/data/gapic/api/artman_${API_SHORT_NAME}.yaml', 'test/cli/data/gapic/core/artman_${API_SHORT_NAME}.yaml'] expected = [ 'test/cli/data/gapic/api/artman_pubsub.yaml', 'test/cli/data/gapic/api/artman_logging.yaml', 'test/cli/data/gapic/core/artman_core.yaml', ] actual = batch_generation._get_artman_config_filenames( api_config_patterns, 'pubsub,logging,core', []) assert expected == actual
def test_get_artman_config_filenames_list(): api_config_patterns = [ 'test/cli/data/gapic/api/artman_${API_SHORT_NAME}.yaml', 'test/cli/data/gapic/core/artman_${API_SHORT_NAME}.yaml' ] expected = [ 'test/cli/data/gapic/api/artman_logging.yaml', 'test/cli/data/gapic/api/artman_longrunning.yaml', ] actual = batch_generation._get_artman_config_filenames( api_config_patterns, ['logging', 'longrunning'], []) assert expected == actual
def test_get_artman_config_filenames_comma_separated(): api_config_patterns = [ 'test/cli/data/gapic/api/artman_${API_SHORT_NAME}.yaml', 'test/cli/data/gapic/core/artman_${API_SHORT_NAME}.yaml' ] expected = [ 'test/cli/data/gapic/api/artman_pubsub.yaml', 'test/cli/data/gapic/api/artman_logging.yaml', 'test/cli/data/gapic/core/artman_core.yaml', ] actual = batch_generation._get_artman_config_filenames( api_config_patterns, 'pubsub,logging,core', []) assert expected == actual
def test_get_artman_config_filenames_wildcard(): api_config_patterns = ['test/cli/data/gapic/api/artman_${API_SHORT_NAME}.yaml', 'test/cli/data/gapic/core/artman_${API_SHORT_NAME}.yaml'] expected = [ 'test/cli/data/gapic/api/artman_compute.yaml', 'test/cli/data/gapic/api/artman_logging.yaml', 'test/cli/data/gapic/api/artman_longrunning.yaml', 'test/cli/data/gapic/api/artman_pubsub.yaml', 'test/cli/data/gapic/core/artman_core.yaml', ] actual = batch_generation._get_artman_config_filenames( api_config_patterns, '*', []) assert expected == actual
def test_get_artman_config_filenames_wildcard(): api_config_patterns = [ 'test/cli/data/gapic/api/artman_${API_SHORT_NAME}.yaml', 'test/cli/data/gapic/core/artman_${API_SHORT_NAME}.yaml' ] expected = [ 'test/cli/data/gapic/api/artman_logging.yaml', 'test/cli/data/gapic/api/artman_longrunning.yaml', 'test/cli/data/gapic/api/artman_pubsub.yaml', 'test/cli/data/gapic/core/artman_core.yaml', ] actual = batch_generation._get_artman_config_filenames( api_config_patterns, '*') assert expected == actual