(self)
| 2286 | self.assertEqual(var.url, "/repos/lazy/repo/actions/variables/var%20name") |
| 2287 | |
| 2288 | def testRepoVariables(self): |
| 2289 | # GitHub will always capitalize the variable name |
| 2290 | variables = (("VARIABLE_NAME_ONE", "variable-value-one"), ("VARIABLE_NAME_TWO", "variable-value-two")) |
| 2291 | repo = self.g.get_repo("AndrewJDawes/PyGithub") |
| 2292 | for variable in variables: |
| 2293 | repo.create_variable(variable[0], variable[1]) |
| 2294 | repo.update() |
| 2295 | repo_variables = repo.get_variables() |
| 2296 | matched_repo_variables = [] |
| 2297 | for variable in variables: |
| 2298 | for repo_variable in repo_variables: |
| 2299 | # GitHub will always capitalize the variable name, may be best to uppercase test data for comparison |
| 2300 | if repo_variable.name == variable[0].upper() and repo_variable.value == variable[1]: |
| 2301 | matched_repo_variables.append(repo_variable) |
| 2302 | break |
| 2303 | self.assertEqual(len(matched_repo_variables), len(variables)) |
| 2304 | for matched_repo_variable in matched_repo_variables: |
| 2305 | matched_repo_variable.delete() |
| 2306 | |
| 2307 | @mock.patch("github.PublicKey.encrypt") |
| 2308 | def testCreateRepoActionsSecret(self, encrypt): |
nothing calls this directly
no test coverage detected