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

Method testOrgSecretEdit

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

Source from the content-addressed store, hash-verified

693
694 @mock.patch("github.PublicKey.encrypt")
695 def testOrgSecretEdit(self, encrypt):
696 org = self.g.get_organization("demoorg")
697 repos = [org.get_repo("demo-repo-1"), org.get_repo("demo-repo-2")]
698 # encrypt returns a non-deterministic value, we need to mock it so the replay data matches
699 encrypt.return_value = "M+5Fm/BqTfB90h3nC7F3BoZuu3nXs+/KtpXwxm9gG211tbRo0F5UiN0OIfYT83CKcx9oKES9Va4E96/b"
700 secret = org.create_secret(
701 secret_name="secret_act_name",
702 unencrypted_value="secret-value",
703 visibility="selected",
704 secret_type="actions",
705 selected_repositories=repos,
706 )
707
708 with self.assertRaises(AssertionError) as exc:
709 secret.edit(value="newvalue", secret_type="supersecret")
710 self.assertEqual(str(exc.exception), "secret_type should be actions or dependabot")
711
712 def testCreateCustomProperties(self):
713 properties = [

Callers

nothing calls this directly

Calls 4

get_organizationMethod · 0.80
get_repoMethod · 0.45
create_secretMethod · 0.45
editMethod · 0.45

Tested by

no test coverage detected