Did I find the right examples for you? yes no

All Samples(3)  |  Call(0)  |  Derive(0)  |  Import(3)

src/s/w/switchboard-1.1.1/switchboard/manager.py   switchboard(Download)
from . import signals
from .base import MongoModelDict
from .models import (
    MongoModel,
    Switch,

src/s/w/switchboard-1.1.1/switchboard/tests/test_testutils.py   switchboard(Download)
)
 
from ..models import (
    Switch,
    DISABLED, GLOBAL,
        assert_equals(self.operator['test'].status, DISABLED)
 
        switch.status = GLOBAL
        switch.save()
 
 
        assert_false(test2())
        assert_equals(self.operator['test'].status, GLOBAL)
 
    def test_context_manager(self):
        assert_equals(self.operator['test'].status, DISABLED)
 
        switch.status = GLOBAL
        switch.save()
 
        with switches(self.operator, test=False):
            assert_false(self.operator.is_active('test'))
 
        assert_equals(self.operator['test'].status, GLOBAL)

src/s/w/switchboard-1.1.1/switchboard/tests/test_manager.py   switchboard(Download)
)
from ..decorators import switch_is_active
from ..models import (
    Switch,
    SELECTIVE, DISABLED, GLOBAL, INHERIT,
        assert_false(self.operator.is_active('test', req))
 
        switch.status = GLOBAL
        switch.save()
 
 
        switch = self.operator['test']
        switch.status = GLOBAL
 
        req.environ['REMOTE_ADDR'] = '1.1.1.1'
        Switch.create(
            key='test:child',
            status=GLOBAL,
        )
 
    def test_child_state_is_used(self):
        Switch.create(
            key='test',
            status=GLOBAL,
        )