Esempio n. 1
0
 def test_load_terraform_registry_check_cache(self):
     registry = ModuleLoaderRegistry(download_external_modules=True)
     registry.root_dir = self.current_dir
     source1 = "git::https://github.com/bridgecrewio/checkov_not_working1.git"
     registry.load(current_dir=self.current_dir, source=source1, source_version="latest")
     self.assertIn(source1, registry.failed_urls_cache)
     source2 = "git::https://github.com/bridgecrewio/checkov_not_working2.git"
     registry.load(current_dir=self.current_dir, source=source2, source_version="latest")
     self.assertIn(source1 in registry.failed_urls_cache and source2, registry.failed_urls_cache)
Esempio n. 2
0
 def test_load_terraform_registry(self):
     registry = ModuleLoaderRegistry(True, DEFAULT_EXTERNAL_MODULES_DIR)
     registry.root_dir = self.current_dir
     source = "terraform-aws-modules/security-group/aws"
     content = registry.load(current_dir=self.current_dir, source=source, source_version="~> 3.0")
     assert content.loaded()
     expected_content_path = os.path.join(
         self.current_dir,
         DEFAULT_EXTERNAL_MODULES_DIR,
         "github.com/terraform-aws-modules/terraform-aws-security-group",
     )
     self.assertRegex(content.path(), f"^{expected_content_path}/v3.*")