Beispiel #1
0
    def test_register(self):
        from ptah.config import _ViewLayersManager

        manager = _ViewLayersManager()

        manager.register('test', (1,))
        manager.register('test2', (1,))
        manager.register('', (1,))

        self.assertEqual(manager.layers[(1,)], ['', 'test', 'test2'])
Beispiel #2
0
    def test_register(self):
        from ptah.config import _ViewLayersManager

        manager = _ViewLayersManager()

        manager.register('test', (1, ))
        manager.register('test2', (1, ))
        manager.register('', (1, ))

        self.assertEqual(manager.layers[(1, )], ['', 'test', 'test2'])
Beispiel #3
0
    def test_enabled(self):
        from ptah.config import _ViewLayersManager

        manager = _ViewLayersManager()

        manager.register('test', (1,))
        manager.register('test2', (1,))
        manager.register('', (1,))

        self.assertFalse(manager.enabled('test', (1,)))
        self.assertTrue(manager.enabled('test2', (1,)))
        self.assertFalse(manager.enabled('test', (2,)))
Beispiel #4
0
    def test_enabled(self):
        from ptah.config import _ViewLayersManager

        manager = _ViewLayersManager()

        manager.register('test', (1, ))
        manager.register('test2', (1, ))
        manager.register('', (1, ))

        self.assertFalse(manager.enabled('test', (1, )))
        self.assertTrue(manager.enabled('test2', (1, )))
        self.assertFalse(manager.enabled('test', (2, )))