(self)
| 202 | repo.delete_environment("test") |
| 203 | |
| 204 | def testEnvironmentVariables(self): |
| 205 | # GitHub will always capitalize the variable name |
| 206 | variables = (("VARIABLE_NAME_ONE", "variable-value-one"), ("VARIABLE_NAME_TWO", "variable-value-two")) |
| 207 | repo = self.g.get_repo("AndrewJDawes/PyGithub") |
| 208 | environment = repo.create_environment("test") |
| 209 | for variable in variables: |
| 210 | environment.create_variable(variable[0], variable[1]) |
| 211 | environment.update() |
| 212 | environment_variables = environment.get_variables() |
| 213 | matched_environment_variables = [] |
| 214 | for variable in variables: |
| 215 | for environment_variable in environment_variables: |
| 216 | # GitHub will always capitalize the variable name, may be best to uppercase test data for comparison |
| 217 | if environment_variable.name == variable[0].upper() and environment_variable.value == variable[1]: |
| 218 | matched_environment_variables.append(environment_variable) |
| 219 | break |
| 220 | self.assertEqual(len(matched_environment_variables), len(variables)) |
| 221 | for matched_environment_variable in matched_environment_variables: |
| 222 | matched_environment_variable.delete() |
| 223 | repo.delete_environment("test") |
| 224 | |
| 225 | @mock.patch("github.PublicKey.encrypt") |
| 226 | def testEnvironmentSecret(self, encrypt): |
nothing calls this directly
no test coverage detected