Skip to content

Commit

Permalink
skip: fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
DnPlas committed Mar 1, 2024
1 parent c0faa04 commit ade4b21
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/charms/mlops_libs/v0/k8s_service_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ class KubernetesServiceInfoRequirer(Object):
charm (CharmBase): variable for storing the requirer application
relation_name (str): variable for storing the name of the relation
"""

on = KubernetesServiceInfoEvents()

def __init__(
Expand Down
8 changes: 5 additions & 3 deletions tests/unit/test_k8s_service_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_requirer_get_data_from_requirer(requirer_charm_harness):
# Add and update relation
expected_data = KubernetesServiceInfoObject(name="some-service", port="7878")
data_dict = {"name": expected_data.name, "port": expected_data.port}
rel_id = requirer_charm_harness.add_relation(TEST_RELATION_NAME, "app", app_data=data_dict)
requirer_charm_harness.add_relation(TEST_RELATION_NAME, "app", app_data=data_dict)

# Get the relation data
actual_relation_data = requirer_charm_harness.charm._k8s_svc_info_requirer.get_data()
Expand All @@ -87,9 +87,11 @@ def test_get_k8s_svc_info_on_refresh_event(requirer_charm_harness):
expected_data = KubernetesServiceInfoObject(name="some-service", port="7878")
data_dict = {"name": expected_data.name, "port": expected_data.port}
rel_id = requirer_charm_harness.add_relation(TEST_RELATION_NAME, "app", app_data=data_dict)
relation = requirer_charm_harness.charm.framework.model.get_relation(TEST_RELATION_NAME, rel_id)
relation = requirer_charm_harness.charm.framework.model.get_relation(
TEST_RELATION_NAME, rel_id
)
requirer_charm_harness.charm.on[TEST_RELATION_NAME].relation_joined.emit(relation)


def test_check_raise_too_many_relations(requirer_charm_harness):
"""Assert that TooManyRelatedAppsError is raised if more than one application is related."""
Expand Down

0 comments on commit ade4b21

Please sign in to comment.