Skip to content

Commit

Permalink
Linting and fix UTs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamieparsons committed Sep 5, 2023
1 parent 86c3e1e commit e5a6e44
Show file tree
Hide file tree
Showing 10 changed files with 1,220 additions and 1,800 deletions.
1 change: 1 addition & 0 deletions src/aosm/azext_aosm/_client_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.cli.core.profiles import ResourceType
from azure.mgmt.containerregistry import ContainerRegistryManagementClient

from .vendored_sdks import HybridNetworkManagementClient

Expand Down
2 changes: 1 addition & 1 deletion src/aosm/azext_aosm/_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def validate(self):


@dataclass
class NFDRETConfiguration:
class NFDRETConfiguration: # pylint: disable=too-many-instance-attributes
"""The configuration required for an NFDV that you want to include in an NSDV."""

publisher: str = PUBLISHER_NAME
Expand Down
2 changes: 2 additions & 0 deletions src/aosm/azext_aosm/deploy/artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ def _get_acr(self) -> str:
:return: The name of the ACR
"""
assert hasattr(self.artifact_client, "remote")
if not self.artifact_client.remote.hostname:
raise ValueError(
"Cannot upload artifact. Oras client has no remote hostname."
Expand Down Expand Up @@ -390,6 +391,7 @@ def _push_image_from_local_registry(
:param target_password: The password to use for the az acr login attempt
:type target_password: str
"""
assert hasattr(self.artifact_client, "remote")
target_acr = self._get_acr()
try:
target = self._get_acr_target_image()
Expand Down
3 changes: 2 additions & 1 deletion src/aosm/azext_aosm/tests/latest/mock_nsd/input.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"type": "vnf",
"multiple_instances": false,
"publisher": "jamie-mobile-publisher",
"publisher_resource_group": "Jamie-publisher"
"publisher_resource_group": "Jamie-publisher",
"publisher_scope": "private"
}
],
"nsdg_name": "ubuntu",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
{
"publisher": "reference-publisher",
"publisher_resource_group": "Reference-publisher",
"publisher_scope": "private",
"name": "nginx-nfdg",
"version": "1.0.0",
"publisher_offering_location": "eastus",
Expand All @@ -16,6 +17,7 @@
{
"publisher": "reference-publisher",
"publisher_resource_group": "Reference-publisher",
"publisher_scope": "private",
"name": "ubuntu-nfdg",
"version": "1.0.0",
"publisher_offering_location": "eastus",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"publisher_offering_location": "eastus",
"type": "vnf",
"multiple_instances": true,
"publisher_scope": "private",
"publisher": "jamie-mobile-publisher",
"publisher_resource_group": "Jamie-publisher"
}
Expand Down
3,005 changes: 1,208 additions & 1,797 deletions src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"type": "cnf",
"multiple_instances": false,
"publisher": "nginx-publisher",
"publisher_scope": "private",
"publisher_resource_group": "{{publisher_resource_group_name}}"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"type": "vnf",
"multiple_instances": false,
"publisher": "ubuntuPublisher",
"publisher_scope": "private",
"publisher_resource_group": "{{publisher_resource_group_name}}"
}
],
Expand Down
2 changes: 1 addition & 1 deletion src/aosm/azext_aosm/tests/latest/test_nsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def get(self, network_function_definition_group_name, **_):

class AOSMClient:
def __init__(self) -> None:
self.network_function_definition_versions = NFDVs()
self.proxy_network_function_definition_versions = NFDVs()


mock_client = AOSMClient()
Expand Down

0 comments on commit e5a6e44

Please sign in to comment.