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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 4
0
    def test_context_manager_overrides_swich_setting(self):
        eq_(gutter.active('foo'), False)

        with switches(foo=True):
            eq_(gutter.active('foo'), True)
Esempio n. 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
Esempio n. 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