コード例 #1
0
    def setUp(self):
        self.endpoint = SentryAppBaseEndpoint()

        self.user = self.create_user()
        self.org = self.create_organization(owner=self.user)

        self.request = self.make_request(user=self.user, method="GET")

        self.sentry_app = self.create_sentry_app(name="foo", organization=self.org)
コード例 #2
0
class SentryAppBaseEndpointTest(TestCase):
    def setUp(self):
        self.endpoint = SentryAppBaseEndpoint()

        self.user = self.create_user()
        self.org = self.create_organization(owner=self.user)

        self.request = self.make_request(user=self.user, method="GET")

        self.sentry_app = self.create_sentry_app(name="foo", organization=self.org)

    def test_retrieves_sentry_app(self):
        args, kwargs = self.endpoint.convert_args(self.request, self.sentry_app.slug)
        assert kwargs["sentry_app"] == self.sentry_app

    def test_raises_when_sentry_app_not_found(self):
        with self.assertRaises(Http404):
            self.endpoint.convert_args(self.request, "notanapp")
コード例 #3
0
ファイル: test_sentryapps.py プロジェクト: Kayle009/sentry
    def setUp(self):
        self.endpoint = SentryAppBaseEndpoint()

        self.user = self.create_user()
        self.org = self.create_organization(owner=self.user)

        self.request = self.make_request(user=self.user, method='GET')

        self.sentry_app = self.create_sentry_app(
            name='foo',
            organization=self.org,
        )
コード例 #4
0
ファイル: test_sentryapps.py プロジェクト: Kayle009/sentry
class SentryAppBaseEndpointTest(TestCase):
    def setUp(self):
        self.endpoint = SentryAppBaseEndpoint()

        self.user = self.create_user()
        self.org = self.create_organization(owner=self.user)

        self.request = self.make_request(user=self.user, method='GET')

        self.sentry_app = self.create_sentry_app(
            name='foo',
            organization=self.org,
        )

    def test_retrieves_sentry_app(self):
        args, kwargs = self.endpoint.convert_args(self.request, self.sentry_app.slug)
        assert kwargs['sentry_app'] == self.sentry_app

    def test_raises_when_sentry_app_not_found(self):
        with self.assertRaises(Http404):
            self.endpoint.convert_args(self.request, 'notanapp')