Exemple #1
0
 def test_multiple_lookups_string(self):
     lookups = extract_lookups(
         "url://${output fakeStack::FakeOutput}@"
         "${output fakeStack::FakeOutput2}"
     )
     self.assertEqual(len(lookups), 2)
     self.assertEqual(list(lookups)[0].type, "output")
Exemple #2
0
 def test_lookups_mixed(self):
     lookups = extract_lookups({
         "something": "${output fakeStack::FakeOutput}",
         "list": ["value", "${output fakeStack::FakeOutput2}"],
         "dict": {
             "other": "value",
             "another": "${output fakeStack::FakeOutput3}",
         },
     })
     self.assertEqual(len(lookups), 3)
Exemple #3
0
 def test_kms_lookup_with_region(self):
     lookups = extract_lookups(
         "${kms us-west-2@CiADsGxJp1mCR21fjsVjVxr7RwuO2FE3ZJqC4iG0Lm+HkRKwAQEBAgB4A7BsSadZgkdtX47FY1ca+0cLjthRN2SaguIhtC5vh5EAAACHMIGEBgkqhkiG9w0BBwagdzB1AgEAMHAGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQM3IKyEoNEQVxN3BaaAgEQgEOpqa0rcl3WpHOmblAqL1rOPRyokO3YXcJAAB37h/WKLpZZRAWV2h9C67xjlsj3ebg+QIU91T/}"
     )  # NOQA
     self.assertEqual(len(lookups), 1)
     lookup = list(lookups)[0]
     self.assertEqual(lookup.type, "kms")
     self.assertEqual(
         lookup.input,
         "us-west-2@CiADsGxJp1mCR21fjsVjVxr7RwuO2FE3ZJqC4iG0Lm+HkRKwAQEBAgB4A7BsSadZgkdtX47FY1ca+0cLjthRN2SaguIhtC5vh5EAAACHMIGEBgkqhkiG9w0BBwagdzB1AgEAMHAGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQM3IKyEoNEQVxN3BaaAgEQgEOpqa0rcl3WpHOmblAqL1rOPRyokO3YXcJAAB37h/WKLpZZRAWV2h9C67xjlsj3ebg+QIU91T/"
     )  # NOQA
Exemple #4
0
 def test_lookups_mixed(self):
     lookups = extract_lookups({
         "something":
         "${fakeStack::FakeOutput}",
         "list": ["value", "${fakeStack::FakeOutput2}"],
         "dict": {
             "other": "value",
             "another": "${fakeStack::FakeOutput3}",
         },
     })
     self.assertEqual(len(lookups), 3)
Exemple #5
0
 def test_kms_lookup_with_equals(self):
     lookups = extract_lookups(
         "${kms us-east-1@AQECAHjLp186mZ+mgXTQSytth/ibiIdwBm8CZAzZNSaSkSRqswAAAG4wbAYJKoZIhvcNAQcGoF8wXQIBADBYBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDLNmhGU6fe4vp175MAIBEIAr+8tUpi7SDzOZm+FFyYvWXhs4hEEyaazIn2dP8a+yHzZYDSVYGRpfUz34bQ==}"
     )  # NOQA
     self.assertEqual(len(lookups), 1)
     lookup = list(lookups)[0]
     self.assertEqual(lookup.type, "kms")
     self.assertEqual(
         lookup.input,
         "us-east-1@AQECAHjLp186mZ+mgXTQSytth/ibiIdwBm8CZAzZNSaSkSRqswAAAG4wbAYJKoZIhvcNAQcGoF8wXQIBADBYBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDLNmhGU6fe4vp175MAIBEIAr+8tUpi7SDzOZm+FFyYvWXhs4hEEyaazIn2dP8a+yHzZYDSVYGRpfUz34bQ=="
     )  # NOQA
Exemple #6
0
 def test_lookups_dict(self):
     lookups = extract_lookups({
         "something": "${fakeStack::FakeOutput}",
         "other": "value",
     })
     self.assertEqual(len(lookups), 1)
Exemple #7
0
 def test_lookups_list(self):
     lookups = extract_lookups(["something", "${fakeStack::FakeOutput}"])
     self.assertEqual(len(lookups), 1)
Exemple #8
0
 def test_multiple_lookups_string(self):
     lookups = extract_lookups(
         "url://${fakeStack::FakeOutput}@${fakeStack::FakeOutput2}")
     self.assertEqual(len(lookups), 2)
     self.assertEqual(list(lookups)[0].type, "output")
Exemple #9
0
 def test_single_lookup_string(self):
     lookups = extract_lookups("${output fakeStack::FakeOutput}")
     self.assertEqual(len(lookups), 1)
Exemple #10
0
 def test_single_lookup_string(self):
     lookups = extract_lookups("${output fakeStack::FakeOutput}")
     self.assertEqual(len(lookups), 1)
Exemple #11
0
 def test_comma_delimited(self):
     lookups = extract_lookups("${noop val1,val2}")
     self.assertEqual(len(lookups), 1)
Exemple #12
0
 def test_kms_lookup_with_equals(self):
     lookups = extract_lookups("${kms us-east-1@AQECAHjLp186mZ+mgXTQSytth/ibiIdwBm8CZAzZNSaSkSRqswAAAG4wbAYJKoZIhvcNAQcGoF8wXQIBADBYBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDLNmhGU6fe4vp175MAIBEIAr+8tUpi7SDzOZm+FFyYvWXhs4hEEyaazIn2dP8a+yHzZYDSVYGRpfUz34bQ==}")  # NOQA
     self.assertEqual(len(lookups), 1)
     lookup = list(lookups)[0]
     self.assertEqual(lookup.type, "kms")
     self.assertEqual(lookup.input, "us-east-1@AQECAHjLp186mZ+mgXTQSytth/ibiIdwBm8CZAzZNSaSkSRqswAAAG4wbAYJKoZIhvcNAQcGoF8wXQIBADBYBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDLNmhGU6fe4vp175MAIBEIAr+8tUpi7SDzOZm+FFyYvWXhs4hEEyaazIn2dP8a+yHzZYDSVYGRpfUz34bQ==")  # NOQA
Exemple #13
0
 def test_comma_delimited(self):
     lookups = extract_lookups("${noop val1,val2}")
     self.assertEqual(len(lookups), 1)
Exemple #14
0
 def test_nested_lookups_string(self):
     lookups = extract_lookups(
         "${noop ${output stack::Output},${output stack::Output2}}"
     )
     self.assertEqual(len(lookups), 2)
Exemple #15
0
 def test_lookups_dict(self):
     lookups = extract_lookups({
         "something": "${output fakeStack::FakeOutput}",
         "other": "value",
     })
     self.assertEqual(len(lookups), 1)
Exemple #16
0
 def test_lookups_list(self):
     lookups = extract_lookups([
         "something",
         "${output fakeStack::FakeOutput}"
     ])
     self.assertEqual(len(lookups), 1)
Exemple #17
0
 def test_nested_lookups_string(self):
     lookups = extract_lookups(
         "${noop ${output stack::Output},${output stack::Output2}}")
     self.assertEqual(len(lookups), 2)
Exemple #18
0
 def test_kms_lookup_with_region(self):
     lookups = extract_lookups("${kms us-west-2@CiADsGxJp1mCR21fjsVjVxr7RwuO2FE3ZJqC4iG0Lm+HkRKwAQEBAgB4A7BsSadZgkdtX47FY1ca+0cLjthRN2SaguIhtC5vh5EAAACHMIGEBgkqhkiG9w0BBwagdzB1AgEAMHAGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQM3IKyEoNEQVxN3BaaAgEQgEOpqa0rcl3WpHOmblAqL1rOPRyokO3YXcJAAB37h/WKLpZZRAWV2h9C67xjlsj3ebg+QIU91T/}")  # NOQA
     self.assertEqual(len(lookups), 1)
     lookup = list(lookups)[0]
     self.assertEqual(lookup.type, "kms")
     self.assertEqual(lookup.input, "us-west-2@CiADsGxJp1mCR21fjsVjVxr7RwuO2FE3ZJqC4iG0Lm+HkRKwAQEBAgB4A7BsSadZgkdtX47FY1ca+0cLjthRN2SaguIhtC5vh5EAAACHMIGEBgkqhkiG9w0BBwagdzB1AgEAMHAGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQM3IKyEoNEQVxN3BaaAgEQgEOpqa0rcl3WpHOmblAqL1rOPRyokO3YXcJAAB37h/WKLpZZRAWV2h9C67xjlsj3ebg+QIU91T/")  # NOQA
Exemple #19
0
 def test_no_lookups(self):
     lookups = extract_lookups("value")
     self.assertEqual(lookups, set())
Exemple #20
0
 def test_kms_file_lookup(self):
     lookups = extract_lookups("${kms file://path/to/some/file.txt}")
     self.assertEqual(len(lookups), 1)
     lookup = list(lookups)[0]
     self.assertEqual(lookup.type, "kms")
     self.assertEqual(lookup.input, "file://path/to/some/file.txt")
Exemple #21
0
 def test_kms_file_lookup(self):
     lookups = extract_lookups("${kms file://path/to/some/file.txt}")
     self.assertEqual(len(lookups), 1)
     lookup = list(lookups)[0]
     self.assertEqual(lookup.type, "kms")
     self.assertEqual(lookup.input, "file://path/to/some/file.txt")
Exemple #22
0
 def test_no_lookups(self):
     lookups = extract_lookups("value")
     self.assertEqual(lookups, set())