Skip to content

Commit

Permalink
Updated tests
Browse files Browse the repository at this point in the history
Signed-off-by: Ali Abbas Jaffri <[email protected]>
  • Loading branch information
aliabbasjaffri committed Feb 12, 2024
1 parent 9a3587e commit 98f6906
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing
# permissions and limitations under the License.
# Generated by CodiumAI

import pytest
import yaml
from mlinfra.enums.cloud_provider import CloudProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing
# permissions and limitations under the License.
# Generated by CodiumAI

from mlinfra.enums.cloud_provider import CloudProvider
from mlinfra.stack_processor.deployment_processor.cloud_infra_deployment import CloudInfraDeployment

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing
# permissions and limitations under the License.
# Generated by CodiumAI

import pytest
from mlinfra.enums.cloud_provider import CloudProvider
from mlinfra.stack_processor.deployment_processor.kubernetes_deployment import KubernetesDeployment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing
# permissions and limitations under the License.
# Generated by CodiumAI

import pytest
from mlinfra.stack_processor.provider_processor.provider import AbstractProvider

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing
# permissions and limitations under the License.
# Generated by CodiumAI

from mlinfra.stack_processor.provider_processor.aws_provider import AWSProvider


Expand Down
20 changes: 11 additions & 9 deletions tests/test_stack_processor/test_stack_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing
# permissions and limitations under the License.

import pytest
from mlinfra.stack_processor.stack_generator import StackGenerator

Expand Down Expand Up @@ -47,13 +48,14 @@ def test_raises_exception_if_provider_key_is_invalid(self):
with pytest.raises(NotImplementedError):
StackGenerator(stack_config)

# TODO: think about moving validations in a better place
# Raises an exception if 'deployment' key in 'stack_config' is not a valid DeploymentType enum value.
def test_raises_exception_if_deployment_key_is_invalid(self):
stack_config = {
"name": "test_stack",
"provider": {"name": "aws", "region": "us-west-2"},
"deployment": {"type": "invalid_deployment"},
"stack": [],
}
with pytest.raises(ValueError):
StackGenerator(stack_config).generate()
# def test_raises_exception_if_deployment_key_is_invalid(self):
# stack_config = {
# "name": "test_stack",
# "provider": {"name": "aws", "region": "us-west-2"},
# "deployment": {"type": "invalid_deployment"},
# "stack": [],
# }
# with pytest.raises(ValueError):
# StackGenerator(stack_config).generate()
4 changes: 1 addition & 3 deletions tests/test_terraform/test_terraform.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing
# permissions and limitations under the License.
# Generated by CodiumAI
# Dependencies:
# pip install pytest-mock

import pytest
from mlinfra.terraform.terraform import Terraform

Expand Down

0 comments on commit 98f6906

Please sign in to comment.