fix tests (#3336)
This commit is contained in:
Родитель
4cedc2b127
Коммит
b980d2b17d
|
@ -20,6 +20,7 @@ TEST_PROJECT = "bigquery-etl-integration-test"
|
|||
MOZDATA = "mozdata"
|
||||
PIONEER_NONPROD = "moz-fx-data-pioneer-nonprod"
|
||||
PIONEER_PROD = "moz-fx-data-pioneer-prod"
|
||||
MOZ_FX_DATA_BACKFILL = "moz-fx-data-backfill"
|
||||
|
||||
|
||||
def is_valid_dir(ctx, param, value):
|
||||
|
@ -47,12 +48,18 @@ def is_authenticated():
|
|||
|
||||
def is_valid_project(ctx, param, value):
|
||||
"""Check if the provided project_id corresponds to an existing project."""
|
||||
if value is None or value in [Path(p).name for p in project_dirs()] + [
|
||||
TEST_PROJECT,
|
||||
MOZDATA,
|
||||
PIONEER_NONPROD,
|
||||
PIONEER_PROD,
|
||||
]:
|
||||
if (
|
||||
value is None
|
||||
or value
|
||||
in [Path(p).name for p in project_dirs()]
|
||||
+ [
|
||||
TEST_PROJECT,
|
||||
MOZDATA,
|
||||
PIONEER_NONPROD,
|
||||
PIONEER_PROD,
|
||||
]
|
||||
or value.startswith(MOZ_FX_DATA_BACKFILL)
|
||||
):
|
||||
return value
|
||||
raise click.BadParameter(f"Invalid project {value}")
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ class TestUtils:
|
|||
def test_is_valid_project(self):
|
||||
assert is_valid_project(None, None, "mozfun")
|
||||
assert is_valid_project(None, None, "moz-fx-data-shared-prod")
|
||||
assert is_valid_project(None, None, "moz-fx-data-backfill-1")
|
||||
with pytest.raises(BadParameter):
|
||||
assert is_valid_project(None, None, "not-existing")
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче