This commit is contained in:
Gergő Jedlicska 2023-10-25 17:53:23 +02:00
Родитель 23a5087fbc
Коммит efe9551c5e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 868C59E4F75C7534
2 изменённых файлов: 6 добавлений и 9 удалений

Просмотреть файл

@ -27,7 +27,7 @@ class AutomationRunData(BaseModel):
function_id: str
function_name: str
function_logo: str | None
function_logo: Optional[str]
model_config = ConfigDict(
alias_generator=camelcase, populate_by_name=True, protected_namespaces=()

Просмотреть файл

@ -79,7 +79,7 @@ def automation_run_data(
automation_run_id = crypto_random_string(10)
function_id = crypto_random_string(10)
function_release = crypto_random_string(10)
function_name = f"automate test {crypto_random_string(3)}"
return AutomationRunData(
project_id=project_id,
model_id=model_id,
@ -90,8 +90,8 @@ def automation_run_data(
automation_revision_id=automation_revision_id,
automation_run_id=automation_run_id,
function_id=function_id,
function_release=function_release,
function_name="foobar",
function_name=function_name,
function_logo=None,
)
@ -235,17 +235,14 @@ def test_create_version_in_project_raises_error_for_same_model(
) -> None:
with pytest.raises(ValueError):
automation_context.create_new_version_in_project(
Base(), automation_context.automation_run_data.model_id
Base(), automation_context.automation_run_data.branch_name
)
def test_create_version_in_project(
automation_context: AutomationContext,
) -> None:
model_id = automation_context.speckle_client.branch.create(
automation_context.automation_run_data.project_id, "foobar"
)
root_object = Base()
root_object.foo = "bar"
version_id = automation_context.create_new_version_in_project(root_object, model_id)
version_id = automation_context.create_new_version_in_project(root_object, "foobar")
assert version_id is not None