Skip to content

Commit

Permalink
remove noqa exception in tesst files
Browse files Browse the repository at this point in the history
  • Loading branch information
patriciareinoso committed Apr 12, 2024
1 parent 2577ff9 commit 43e4a20
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def setUp(self) -> None:
self.relation_name = "fiveg_n3"

@patch(f"{TEST_CHARM_PATH}.TEST_UPF_IP_ADDRESS", new_callable=PropertyMock)
def test_given_fiveg_n3_relation_when_relation_created_then_upf_ip_address_is_published_in_the_relation_data( # noqa: E501
def test_given_fiveg_n3_relation_when_relation_created_then_upf_ip_address_is_published_in_the_relation_data(
self, patched_test_upf_ip
):
self.harness.set_leader(is_leader=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def setUp(self) -> None:
self.relation_name = "fiveg_n3"

@patch("charms.sdcore_upf_k8s.v0.fiveg_n3.N3RequirerCharmEvents.fiveg_n3_available")
def test_given_relation_with_n3_provider_when_fiveg_n3_available_event_then_n3_information_is_provided( # noqa: E501
def test_given_relation_with_n3_provider_when_fiveg_n3_available_event_then_n3_information_is_provided(
self, patched_fiveg_n3_available_event
):
test_upf_ip = "1.2.3.4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def setUp(self) -> None:

@patch(f"{TEST_CHARM_PATH}.TEST_UPF_HOSTNAME", new_callable=PropertyMock)
@patch(f"{TEST_CHARM_PATH}.TEST_UPF_PORT", new_callable=PropertyMock)
def test_given_fiveg_n4_relation_when_relation_created_then_upf_hostname_and_upf_port_is_published_in_the_relation_data( # noqa: E501
def test_given_fiveg_n4_relation_when_relation_created_then_upf_hostname_and_upf_port_is_published_in_the_relation_data(
self, patched_test_upf_port, patched_test_upf_hostname
):
self.harness.set_leader(is_leader=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def setUp(self) -> None:
self.relation_name = "fiveg_n4"

@patch("charms.sdcore_upf_k8s.v0.fiveg_n4.N4RequirerCharmEvents.fiveg_n4_available")
def test_given_relation_with_n4_provider_when_fiveg_n4_available_event_then_n4_information_is_provided( # noqa: E501
def test_given_relation_with_n4_provider_when_fiveg_n4_available_event_then_n4_information_is_provided(
self, patched_fiveg_n4_available_event
):
test_upf_hostname = "upf.edge-cloud.test.com"
Expand Down
20 changes: 10 additions & 10 deletions tests/unit/test_dpdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def setUp(self) -> None:
)

@patch("lightkube.core.client.Client.get")
def test_given_lightkube_client_returns_api_error_on_get_when_container_configured_for_dpdk_called_then_dpdk_statefulset_updater_error_is_raised( # noqa: E501
def test_given_lightkube_client_returns_api_error_on_get_when_container_configured_for_dpdk_called_then_dpdk_statefulset_updater_error_is_raised(
self, patched_lightkube_client_get
):
patched_lightkube_client_get.side_effect = ApiError(response=MagicMock())
Expand All @@ -46,7 +46,7 @@ def test_given_lightkube_client_returns_api_error_on_get_when_container_configur
self.dpdk_statefulset_updater.is_configured("justatest")

@patch("lightkube.core.client.Client.get")
def test_given_container_not_is_statefulset_when_container_configured_for_dpdk_called_then_dpdk_statefulset_updater_error_is_raised( # noqa: E501
def test_given_container_not_is_statefulset_when_container_configured_for_dpdk_called_then_dpdk_statefulset_updater_error_is_raised(
self, patched_lightkube_client_get
):
test_statefulset = StatefulSet(
Expand All @@ -62,7 +62,7 @@ def test_given_container_not_is_statefulset_when_container_configured_for_dpdk_c
self.dpdk_statefulset_updater.is_configured("justatest")

@patch("lightkube.core.client.Client.get")
def test_given_container_is_not_privileged_when_container_configured_for_dpdk_called_then_false_is_returned( # noqa: E501
def test_given_container_is_not_privileged_when_container_configured_for_dpdk_called_then_false_is_returned(
self, patched_lightkube_client_get
):
test_statefulset = StatefulSet(
Expand All @@ -86,7 +86,7 @@ def test_given_container_is_not_privileged_when_container_configured_for_dpdk_ca
self.assertFalse(self.dpdk_statefulset_updater.is_configured(TEST_CONTAINER_NAME))

@patch("lightkube.core.client.Client.get")
def test_given_resource_requirements_not_applied_to_the_container_when_container_configured_for_dpdk_called_then_false_is_returned( # noqa: E501
def test_given_resource_requirements_not_applied_to_the_container_when_container_configured_for_dpdk_called_then_false_is_returned(
self, patched_lightkube_client_get
):
test_statefulset = StatefulSet(
Expand All @@ -111,7 +111,7 @@ def test_given_resource_requirements_not_applied_to_the_container_when_container
self.assertFalse(self.dpdk_statefulset_updater.is_configured(TEST_CONTAINER_NAME))

@patch("lightkube.core.client.Client.get")
def test_given_resource_requests_applied_but_limits_not_applied_to_the_container_when_container_configured_for_dpdk_called_then_false_is_returned( # noqa: E501
def test_given_resource_requests_applied_but_limits_not_applied_to_the_container_when_container_configured_for_dpdk_called_then_false_is_returned(
self, patched_lightkube_client_get
):
self.dpdk_statefulset_updater.dpdk_resource_requirements = TEST_RESOURCE_REQUIREMENTS
Expand Down Expand Up @@ -140,7 +140,7 @@ def test_given_resource_requests_applied_but_limits_not_applied_to_the_container
self.assertFalse(self.dpdk_statefulset_updater.is_configured(TEST_CONTAINER_NAME))

@patch("lightkube.core.client.Client.get")
def test_given_resource_limits_applied_but_requests_not_applied_to_the_container_when_container_configured_for_dpdk_called_then_false_is_returned( # noqa: E501
def test_given_resource_limits_applied_but_requests_not_applied_to_the_container_when_container_configured_for_dpdk_called_then_false_is_returned(
self, patched_lightkube_client_get
):
self.dpdk_statefulset_updater.dpdk_resource_requirements = TEST_RESOURCE_REQUIREMENTS
Expand Down Expand Up @@ -169,7 +169,7 @@ def test_given_resource_limits_applied_but_requests_not_applied_to_the_container
self.assertFalse(self.dpdk_statefulset_updater.is_configured(TEST_CONTAINER_NAME))

@patch("lightkube.core.client.Client.get")
def test_given_container_is_privileged_and_has_resource_requirements_applied_when_container_configured_for_dpdk_called_then_true_is_returned( # noqa: E501
def test_given_container_is_privileged_and_has_resource_requirements_applied_when_container_configured_for_dpdk_called_then_true_is_returned(
self, patched_lightkube_client_get
):
self.dpdk_statefulset_updater.dpdk_resource_requirements = TEST_RESOURCE_REQUIREMENTS
Expand Down Expand Up @@ -198,7 +198,7 @@ def test_given_container_is_privileged_and_has_resource_requirements_applied_whe
self.assertTrue(self.dpdk_statefulset_updater.is_configured(TEST_CONTAINER_NAME))

@patch("lightkube.core.client.Client.get")
def test_given_container_exists_and_requires_configuration_when_configure_container_for_dpdk_then_container_is_configured( # noqa: E501
def test_given_container_exists_and_requires_configuration_when_configure_container_for_dpdk_then_container_is_configured(
self, patched_lightkube_client_get
):
self.dpdk_statefulset_updater.dpdk_resource_requirements = TEST_RESOURCE_REQUIREMENTS
Expand Down Expand Up @@ -239,7 +239,7 @@ def test_given_container_exists_and_requires_configuration_when_configure_contai

@patch("lightkube.core.client.Client.get")
@patch("lightkube.core.client.Client.replace")
def test_given_client_when_configure_container_for_dpdk_then_statefulset_is_replaced( # noqa: E501
def test_given_client_when_configure_container_for_dpdk_then_statefulset_is_replaced(
self, patched_lightkube_client_replace, patched_lightkube_client_get
):
self.dpdk_statefulset_updater.dpdk_resource_requirements = TEST_RESOURCE_REQUIREMENTS
Expand Down Expand Up @@ -272,7 +272,7 @@ def test_given_client_when_configure_container_for_dpdk_then_statefulset_is_repl

@patch("lightkube.core.client.Client.get")
@patch("lightkube.core.client.Client.replace")
def test_given_lightkube_client_returns_api_error_on_replace_when_configure_container_for_dpdk_then_dpdk_statefulset_updater_error_is_raised( # noqa: E501
def test_given_lightkube_client_returns_api_error_on_replace_when_configure_container_for_dpdk_then_dpdk_statefulset_updater_error_is_raised(
self, patched_lightkube_client_replace, patched_lightkube_client_get
):
self.dpdk_statefulset_updater.dpdk_resource_requirements = TEST_RESOURCE_REQUIREMENTS
Expand Down

0 comments on commit 43e4a20

Please sign in to comment.