def test_register_fails_default_capability(self):
        self.extension.id = 'diffs'

        self.assertRaisesMessage(
            KeyError,
            '"diffs" is reserved for the default set of capabilities',
            WebAPICapabilitiesHook,
            self.extension,
            {
                'base_commit_ids': False,
                'moved_files': False,
            })

        rsp = self.api_get(path=self.url,
                           expected_mimetype=root_item_mimetype)

        self.assertEqual(rsp['stat'], 'ok')
        self.assertIn('capabilities', rsp)

        caps = rsp['capabilities']
        self.assertIn('diffs', caps)

        diffs_caps = caps['diffs']
        self.assertTrue(diffs_caps['base_commit_ids'])
        self.assertTrue(diffs_caps['moved_files'])

        self.assertRaisesMessage(
            KeyError,
            '"diffs" is not a registered web API capabilities set',
            self.extension.shutdown)
To be called at the beginning of any GET or POST request.
dataset/ETHPy150Open reviewboard/reviewboard/reviewboard/extensions/tests.py/WebAPICapabilitiesHookTests.test_register_fails_default_capability--crossover with--dataset/ETHPy150Open Netflix/security_monkey/security_monkey/views/__init__.py/__check_auth__