MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / testEnvironmentVariables

Method testEnvironmentVariables

tests/Environment.py:204–223  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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):

Callers

nothing calls this directly

Calls 7

create_environmentMethod · 0.80
delete_environmentMethod · 0.80
get_repoMethod · 0.45
create_variableMethod · 0.45
updateMethod · 0.45
get_variablesMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected