Skip to content

Commit

Permalink
refac(versioned_terraofrm_resource): Remove no longer needed attributes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Noahnc committed Dec 5, 2023
1 parent 0c2eda5 commit 6df8995
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 207 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ def test_attributes():
assert provider.base_domain is None
assert provider.identifier == "test_provider/test_provider"

# test code source
module.code_source = "testing/module/test_module"
provider.code_source = "https://github.com/hashicorp/terraform-provider-test"

assert module.is_github_hosted() is False
assert provider.is_github_hosted() is True

# test with custom registry
module = TerraformModule(name="test_resource", current_version="1.0.0", _source_file="test_file.py", _source="testregistry.ch/test/test_module/test_provider")
provider = TerraformProvider(name="test_resource", current_version="1.0.0", _source_file="test_file.py", _source="testregistry.ch/test_provider/test_provider")
Expand Down Expand Up @@ -67,7 +60,6 @@ def test_to_dict():
current_version="1.0.0",
_source_file="test_file.py",
_source="test_provider/test_provider",
code_source="github.com/hashicorp/terraform-provider-test",
)

module_dict = module.to_dict()
Expand Down
5 changes: 0 additions & 5 deletions infrapatch/core/models/versioned_terraform_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ def find(self, resources):
filtered_resources = super().find(resources)
return [resource for resource in filtered_resources if resource._source == self._source]

def is_github_hosted(self) -> bool:
if self.code_source is None:
return False
return self.code_source.lower().startswith("https://github.com")


@dataclass
class TerraformModule(VersionedTerraformResource):
Expand Down
2 changes: 1 addition & 1 deletion infrapatch/core/utils/terraform/hcl_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pygohcl

from infrapatch.core.models.versioned_terraform_resources import TerraformModule, TerraformProvider, VersionedTerraformResource
from infrapatch.core.utils.terraform.hcl_edit_cli import HclEditCli, HclEditCliInterface
from infrapatch.core.utils.terraform.hcl_edit_cli import HclEditCliInterface


class HclParserException(Exception):
Expand Down
193 changes: 0 additions & 193 deletions infrapatch/core/utils/terraform/tests/test_registry_handler.py

This file was deleted.

0 comments on commit 6df8995

Please sign in to comment.