mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
23 lines
665 B
Python
23 lines
665 B
Python
from unittest import TestCase
|
|
|
|
from sentry.api.api_owners import ApiOwner
|
|
|
|
|
|
class APIOwnersTestCase(TestCase):
|
|
teams: set[str] = set()
|
|
|
|
def setUp(self):
|
|
super().setUp()
|
|
code_owners_file = open(".github/CODEOWNERS")
|
|
lines = code_owners_file.readlines()
|
|
code_owners_file.close()
|
|
for line in lines:
|
|
if line.startswith("/src/"):
|
|
tokens = [s.strip() for s in line.split("@getsentry/")]
|
|
self.teams.update(tokens[1:])
|
|
|
|
def test_api_owner_owns_api(self):
|
|
for owner in ApiOwner:
|
|
if owner != ApiOwner.UNOWNED:
|
|
assert owner.value in self.teams
|