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

Method testCreateSecretSelected

tests/Organization.py:499–513  ·  view source on GitHub ↗
(self, encrypt)

Source from the content-addressed store, hash-verified

497
498 @mock.patch("github.PublicKey.encrypt")
499 def testCreateSecretSelected(self, encrypt):
500 repos = [self.org.get_repo("TestPyGithub"), self.org.get_repo("FatherBeaver")]
501 # encrypt returns a non-deterministic value, we need to mock it so the replay data matches
502 encrypt.return_value = "M+5Fm/BqTfB90h3nC7F3BoZuu3nXs+/KtpXwxm9gG211tbRo0F5UiN0OIfYT83CKcx9oKES9Va4E96/b"
503 secret = self.org.create_secret(
504 secret_name="secret-name",
505 unencrypted_value="secret-value",
506 visibility="selected",
507 secret_type="actions",
508 selected_repositories=repos,
509 )
510
511 self.assertIsNotNone(secret)
512 self.assertEqual(secret.visibility, "selected")
513 self.assertEqual(list(secret.selected_repositories), repos)
514
515 def testGetSecret(self):
516 repos = [self.org.get_repo("TestPyGithub"), self.org.get_repo("FatherBeaver")]

Callers

nothing calls this directly

Calls 2

get_repoMethod · 0.45
create_secretMethod · 0.45

Tested by

no test coverage detected