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

Method testEnvironmentSecret

tests/Environment.py:226–236  ·  view source on GitHub ↗
(self, encrypt)

Source from the content-addressed store, hash-verified

224
225 @mock.patch("github.PublicKey.encrypt")
226 def testEnvironmentSecret(self, encrypt):
227 # encrypt returns a non-deterministic value, we need to mock it so the replay data matches
228 encrypt.return_value = "M+5Fm/BqTfB90h3nC7F3BoZuu3nXs+/KtpXwxm9gG211tbRo0F5UiN0OIfYT83CKcx9oKES9Va4E96/b"
229 repo = self.g.get_repo("AndrewJDawes/PyGithub")
230 environment = repo.create_environment("test")
231 secret = environment.create_secret("secret_name", "secret-value")
232 secret.update()
233 # GitHub will always capitalize the secret name
234 self.assertEqual(secret.name, "SECRET_NAME")
235 secret.delete()
236 repo.delete_environment("test")
237
238 @mock.patch("github.PublicKey.encrypt")
239 def testEnvironmentSecrets(self, encrypt):

Callers

nothing calls this directly

Calls 6

create_environmentMethod · 0.80
delete_environmentMethod · 0.80
get_repoMethod · 0.45
create_secretMethod · 0.45
updateMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected