Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
PietroPasotti committed Feb 7, 2024
1 parent 8543e16 commit 6a7727f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions interface_tester/interface_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def assert_schema_valid(self, schema: Optional["DataBagSchema"] = None):
{
"unit": relation.local_unit_data,
"app": relation.local_app_data,
}
},
)
except ValidationError as e:
errors.append(str(e))
Expand Down Expand Up @@ -451,7 +451,7 @@ def _get_endpoint(supported_endpoints: dict, role: Role, interface_name: str):
return endpoints_for_interface[0]

def _generate_relations_state(
self, state_template: State, input_state: State, supported_endpoints, role: Role
self, state_template: State, input_state: State, supported_endpoints, role: Role
) -> List[Relation]:
"""Merge the relations from the input state and the state template into one.
Expand Down
10 changes: 7 additions & 3 deletions tests/unit/test_collect_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

import pytest

from interface_tester.interface_test import _has_pydantic_v1
from interface_tester.collector import (
collect_tests,
get_schema_from_module,
load_schema_module,
)
from interface_tester.interface_test import _has_pydantic_v1


def test_load_schema_module(tmp_path):
Expand Down Expand Up @@ -76,8 +76,12 @@ class RequirerSchema(DataBagSchema):
assert tests["mytestinterfaceb"]["v0"]["requirer"]["schema"].__fields__["foo"].default == 2

else:
assert tests["mytestinterfacea"]["v0"]["requirer"]["schema"].model_fields["foo"].default == 1
assert tests["mytestinterfaceb"]["v0"]["requirer"]["schema"].model_fields["foo"].default == 2
assert (
tests["mytestinterfacea"]["v0"]["requirer"]["schema"].model_fields["foo"].default == 1
)
assert (
tests["mytestinterfaceb"]["v0"]["requirer"]["schema"].model_fields["foo"].default == 2
)


def test_collect_invalid_schemas(tmp_path):
Expand Down

0 comments on commit 6a7727f

Please sign in to comment.