def test_decorator_overrides_switch_setting(self):

        with_decorator = switches(foo=True,
                                  gutter=self.gutter)(self.without_decorator)

        eq_(self.without_decorator(), False)
        eq_(with_decorator(), True)
示例#2
0
    def test_context_manager_overrides_swich_setting(self):
        eq_(self.gutter.active('foo'), False)

        with switches(foo=True, gutter=self.gutter):
            eq_(self.gutter.active('foo'), True)
示例#3
0
    def test_decorator_overrides_switch_setting(self):

        with_decorator = switches(foo=True, gutter=self.gutter)(self.without_decorator)

        eq_(self.without_decorator(), False)
        eq_(with_decorator(), True)
示例#4
0
    def test_context_manager_overrides_swich_setting(self):
        eq_(gutter.active('foo'), False)

        with switches(foo=True):
            eq_(gutter.active('foo'), True)
示例#5
0
    def test_context_manager_overrides_swich_setting(self):
        assert self.gutter.active('foo') is False

        with switches(foo=True, gutter=self.gutter):
            assert self.gutter.active('foo') is True
示例#6
0
    def test_decorator_overrides_switch_setting(self):

        with_decorator = switches(foo=True, gutter=self.gutter)(self.without_decorator)

        assert self.without_decorator() is False
        assert with_decorator() is True