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

Method testInviteUserAsNonOwner

tests/Organization.py:593–606  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

591 self.org.invite_user(email="foo@example.com", role="billing_manager", teams=[team])
592
593 def testInviteUserAsNonOwner(self):
594 with self.assertRaises(github.GithubException) as raisedexp:
595 self.org.invite_user(email="bar@example.com")
596 self.assertEqual(
597 raisedexp.exception.message, "You must be an admin to create an invitation to an organization."
598 )
599 self.assertEqual(raisedexp.exception.status, 403)
600 self.assertEqual(
601 raisedexp.exception.data,
602 {
603 "documentation_url": "https://developer.github.com/v3/orgs/members/#create-organization-invitation",
604 "message": "You must be an admin to create an invitation to an organization.",
605 },
606 )
607
608 def testCreateMigration(self):
609 self.org = self.g.get_organization("sample-test-organisation")

Callers

nothing calls this directly

Calls 1

invite_userMethod · 0.80

Tested by

no test coverage detected