Beispiel #1
0
    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
Beispiel #2
0
 def test_bundle_dry(self):
     retcode = tb.main(["tb", "apply", "mock/withvars", "--dry"])
     print(retcode)
     assert retcode == None
Beispiel #3
0
 def test_showvars_withvars(self):
     retcode = tb.main(["tb", "showvars", "mock/withvars/withvars"])
     assert retcode == 0  # all variables substituted
Beispiel #4
0
 def test_bundle(self):
     retcode = tb.main(["tb", "parse", "mock/withvars"])
     assert retcode == 0
Beispiel #5
0
 def test_missing_remote_state_block(self):
     retcode = tb.main(
         ["tb", "plan", "mock/goodhclt", "--key", "COMPONENT_DIRNAME"])
     assert retcode == 110
Beispiel #6
0
 def test_parse_missingvars(self):
     retcode = tb.main(["tb", "parse", "mock/withvars/missingvars"])
     assert retcode == 120  # not all variables substituted
Beispiel #7
0
 def test_list_components(self):
     retcode = tb.main(["tb", "plan"])
     assert retcode == 100
Beispiel #8
0
 def test_no_component(self):
     retcode = tb.main(["tb", "parse", "not/a/component"])
     assert retcode == -1
Beispiel #9
0
 def test_bad_yml(self):
     try:
         retcode = tb.main(["tb", "parse", "mock/withvars/badyml"])
         assert False
     except yaml.scanner.ScannerError:
         pass
Beispiel #10
0
 def test_good_hclt(self):
     retcode = tb.main(["tb", "parse", "mock/goodhclt"])
     assert retcode == 0
Beispiel #11
0
 def test_bad_hclt(self):
     try:
         retcode = tb.main(["tb", "parse", "mock/badhclt"])
         assert False
     except tb.HclParseException:
         pass