Exemplo n.º 1
0
    def test_default_label_to_id(self):
        """ @tab(id=xx) syntax """
        f = mock.MagicMock(func_name="callme", tab=False, action=False)
        f = tab(id="foo", permission=Permission("foo"))(f)

        assert f.action
        assert f.tab
        assert f.tab_id == "foo"
        assert f.tab_label == "foo"
Exemplo n.º 2
0
 def test_defaults(self):
     """ simple @action() syntax """
     f = mock.MagicMock(func_name="callme", tab=False, action=False)
     f = tab()(f)
     assert f.action
     assert f.tab
     assert f.tab_id == "callme"
     assert f.tab_label == "callme"
     assert f.permission is None
Exemplo n.º 3
0
    def test_arguments(self):
        """ @tab(id=xx, permission=xx) syntax """
        f = mock.MagicMock(tab=False, action=False)
        f = tab(id="foo", label="Bar", permission=Permission("foo"))(f)

        assert f.action
        assert f.tab
        assert f.tab_id == "foo"
        assert f.tab_label == "Bar"
        assert f.permission == Permission("foo")