def setUp(self):
        _privileges_saved = _privileges.copy()
        _privileges.clear()

        def revert():
            _privileges.clear()
            _privileges.update(_privileges_saved)
        self.addCleanup(revert)
Пример #2
0
    def setUp(self):
        _privileges_saved = _privileges.copy()
        _privileges.clear()

        def revert():
            _privileges.clear()
            _privileges.update(_privileges_saved)

        self.addCleanup(revert)
Пример #3
0
    def test_privilege_registration(self):
        _privileges.clear()

        privilege(name="ingest", label="Ingest")
        privilege(name="archive", label="Archive")

        self.assertIn("ingest", _privileges)
        self.assertIn("archive", _privileges)

        self.assertEqual(2, len(get_privilege_list()))
    def test_privilege_registration(self):
        _privileges.clear()

        privilege(name='ingest', label='Ingest')
        privilege(name='archive', label='Archive')

        self.assertIn('ingest', _privileges)
        self.assertIn('archive', _privileges)

        self.assertEqual(2, len(get_privilege_list()))
Пример #5
0
    def test_privilege_registration(self):
        _privileges.clear()

        privilege(name='ingest', label='Ingest')
        privilege(name='archive', label='Archive')

        self.assertIn('ingest', _privileges)
        self.assertIn('archive', _privileges)

        self.assertEqual(2, len(get_privilege_list()))
Пример #6
0
 def revert():
     _privileges.clear()
     _privileges.update(_privileges_saved)
 def revert():
     _privileges.clear()
     _privileges.update(_privileges_saved)