Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update python_sdk to version v1.4.1 against stable #5367

Merged
merged 1 commit into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions backend/tests/integration/profiles/test_profile_lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async def person_profile_1(self, db: InfrahubDatabase, schema_person_base) -> No
async def test_step_01_one_person_no_profile(
self, db: InfrahubDatabase, schema_person_base, person_1, person_profile_1, client: InfrahubClient
):
retrieved_person = await client.get(kind="TestingPerson", id=person_1.id)
retrieved_person = await client.get(kind="TestingPerson", id=person_1.id, property=True)

assert retrieved_person.profiles.peer_ids == []
assert retrieved_person.name.value == "Starbuck"
Expand Down Expand Up @@ -251,7 +251,7 @@ async def test_step_05_add_profile_with_person(

async def test_step_06_get_person_multiple_profiles(self, person_1, person_profile_1, client: InfrahubClient):
person_profile_2 = await client.get(kind="ProfileTestingPerson", profile_name__value="profile-two")
retrieved_person = await client.get(kind="TestingPerson", id=person_1.id)
retrieved_person = await client.get(kind="TestingPerson", id=person_1.id, property=True)
await retrieved_person.profiles.fetch()

assert set(retrieved_person.profiles.peer_ids) == {person_profile_1.id, person_profile_2.id}
Expand All @@ -268,7 +268,7 @@ async def test_step_07_update_person_delete_profile(
default_branch,
client,
):
person_2 = await client.get(kind="TestingPerson", name__value="Apollo")
person_2 = await client.get(kind="TestingPerson", name__value="Apollo", property=True)
mutation = """
mutation {
TestingPersonUpdate(data: {id: "%(person_id)s", profiles: []}) {
Expand Down Expand Up @@ -341,9 +341,9 @@ async def test_step_08_delete_profile(
async def test_step_09_check_persons(
self, db: InfrahubDatabase, person_1, person_profile_1, client: InfrahubClient
):
retrieved_person_1 = await client.get(kind="TestingPerson", id=person_1.id)
retrieved_person_1 = await client.get(kind="TestingPerson", id=person_1.id, property=True)
await retrieved_person_1.profiles.fetch()
retrieved_person_2 = await client.get(kind="TestingPerson", name__value="Apollo")
retrieved_person_2 = await client.get(kind="TestingPerson", name__value="Apollo", property=True)

assert retrieved_person_1.profiles.peer_ids == [person_profile_1.id]
assert retrieved_person_1.name.value == "Kara Thrace"
Expand Down Expand Up @@ -450,9 +450,9 @@ async def test_step_11_add_profile_with_person(
assert attributes["height"] == {"value": 134}

async def test_step_12_check_persons_again(self, person_1, person_profile_1, client: InfrahubClient):
retrieved_person_1 = await client.get(kind="TestingPerson", id=person_1.id)
retrieved_person_1 = await client.get(kind="TestingPerson", id=person_1.id, property=True)
await retrieved_person_1.profiles.fetch()
retrieved_person_2 = await client.get(kind="TestingPerson", name__value="Apollo")
retrieved_person_2 = await client.get(kind="TestingPerson", name__value="Apollo", property=True)

assert retrieved_person_1.profiles.peer_ids == [person_profile_1.id]
assert retrieved_person_1.name.value == "Kara Thrace"
Expand Down
2 changes: 1 addition & 1 deletion python_sdk
Submodule python_sdk updated 73 files
+34 −1 .github/workflows/ci.yml
+15 −0 CHANGELOG.md
+2 −4 infrahub_sdk/_importer.py
+9 −7 infrahub_sdk/analyzer.py
+14 −11 infrahub_sdk/batch.py
+22 −20 infrahub_sdk/branch.py
+14 −41 infrahub_sdk/checks.py
+549 −523 infrahub_sdk/client.py
+6 −4 infrahub_sdk/code_generator.py
+15 −13 infrahub_sdk/config.py
+1 −1 infrahub_sdk/ctl/branch.py
+15 −11 infrahub_sdk/ctl/check.py
+14 −10 infrahub_sdk/ctl/cli_commands.py
+18 −16 infrahub_sdk/ctl/client.py
+6 −7 infrahub_sdk/ctl/config.py
+2 −3 infrahub_sdk/ctl/exporter.py
+11 −8 infrahub_sdk/ctl/generator.py
+3 −2 infrahub_sdk/ctl/repository.py
+7 −3 infrahub_sdk/ctl/schema.py
+13 −9 infrahub_sdk/ctl/utils.py
+3 −2 infrahub_sdk/ctl/validate.py
+3 −3 infrahub_sdk/data.py
+14 −14 infrahub_sdk/exceptions.py
+9 −10 infrahub_sdk/generator.py
+4 −4 infrahub_sdk/graphql.py
+1 −3 infrahub_sdk/groups.py
+146 −129 infrahub_sdk/node.py
+5 −5 infrahub_sdk/object_store.py
+11 −7 infrahub_sdk/playback.py
+30 −30 infrahub_sdk/protocols_base.py
+4 −4 infrahub_sdk/pytest_plugin/items/base.py
+4 −3 infrahub_sdk/pytest_plugin/items/check.py
+2 −2 infrahub_sdk/pytest_plugin/items/graphql_query.py
+5 −5 infrahub_sdk/pytest_plugin/items/jinja2_transform.py
+6 −3 infrahub_sdk/pytest_plugin/items/python_transform.py
+2 −2 infrahub_sdk/pytest_plugin/loader.py
+10 −10 infrahub_sdk/pytest_plugin/models.py
+3 −2 infrahub_sdk/pytest_plugin/plugin.py
+15 −15 infrahub_sdk/query_groups.py
+57 −57 infrahub_sdk/schema/__init__.py
+49 −52 infrahub_sdk/schema/main.py
+7 −11 infrahub_sdk/schema/repository.py
+2 −2 infrahub_sdk/spec/menu.py
+12 −8 infrahub_sdk/spec/object.py
+21 −23 infrahub_sdk/store.py
+20 −22 infrahub_sdk/task_report.py
+9 −5 infrahub_sdk/testing/repository.py
+181 −0 infrahub_sdk/testing/schemas/animal.py
+109 −2 infrahub_sdk/testing/schemas/car_person.py
+1 −2 infrahub_sdk/timestamp.py
+3 −2 infrahub_sdk/transfer/exporter/interface.py
+8 −5 infrahub_sdk/transfer/exporter/json.py
+9 −6 infrahub_sdk/transfer/importer/json.py
+7 −3 infrahub_sdk/transfer/schema_sorter.py
+5 −46 infrahub_sdk/transforms.py
+13 −10 infrahub_sdk/types.py
+5 −5 infrahub_sdk/utils.py
+5 −6 infrahub_sdk/uuidt.py
+8 −6 infrahub_sdk/yaml.py
+16 −2 poetry.lock
+35 −38 pyproject.toml
+545 −545 tests/integration/test_export_import.py
+184 −250 tests/integration/test_infrahub_client.py
+320 −320 tests/integration/test_infrahub_client_sync.py
+63 −107 tests/integration/test_node.py
+19 −19 tests/integration/test_object_store.py
+57 −57 tests/integration/test_schema.py
+6 −0 tests/unit/ctl/test_cli.py
+7 −0 tests/unit/ctl/test_repository_app.py
+7 −4 tests/unit/ctl/test_transform_app.py
+7 −0 tests/unit/ctl/test_validate_app.py
+119 −3 tests/unit/sdk/conftest.py
+530 −61 tests/unit/sdk/test_node.py
Loading