def test_setup_current(self): print(self.terragrunt_mock_path) os.environ["TERRAGRUNT_BIN"] = self.terragrunt_mock_path os.environ["TERRAFORM_BIN"] = os.path.dirname( os.path.realpath(__file__)) + '/bin/mock_terraform_current' retcode = tb.main(["tb", "--check-setup"]) assert retcode == 0
def test_bundle_dry(self): retcode = tb.main(["tb", "apply", "mock/withvars", "--dry"]) print(retcode) assert retcode == None
def test_showvars_withvars(self): retcode = tb.main(["tb", "showvars", "mock/withvars/withvars"]) assert retcode == 0 # all variables substituted
def test_bundle(self): retcode = tb.main(["tb", "parse", "mock/withvars"]) assert retcode == 0
def test_missing_remote_state_block(self): retcode = tb.main( ["tb", "plan", "mock/goodhclt", "--key", "COMPONENT_DIRNAME"]) assert retcode == 110
def test_parse_missingvars(self): retcode = tb.main(["tb", "parse", "mock/withvars/missingvars"]) assert retcode == 120 # not all variables substituted
def test_list_components(self): retcode = tb.main(["tb", "plan"]) assert retcode == 100
def test_no_component(self): retcode = tb.main(["tb", "parse", "not/a/component"]) assert retcode == -1
def test_bad_yml(self): try: retcode = tb.main(["tb", "parse", "mock/withvars/badyml"]) assert False except yaml.scanner.ScannerError: pass
def test_good_hclt(self): retcode = tb.main(["tb", "parse", "mock/goodhclt"]) assert retcode == 0
def test_bad_hclt(self): try: retcode = tb.main(["tb", "parse", "mock/badhclt"]) assert False except tb.HclParseException: pass