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