Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(40)  |  Call(38)  |  Derive(0)  |  Import(2)

src/e/o/Eos-HEAD/tests/fit/holder_container/module_charge/test_module_charge.py   Eos(Download)
from eos.const.eos import State
from eos.fit.holder.container import HolderList
from eos.tests.fit.environment import CachingCharge, CachingModule, OtherCachingHolder
from eos.tests.fit.fit_testcase import FitTestCase
 
    def test_detached_module_none_to_none(self):
        module = CachingModule(1, state=State.active, charge=None)
        module_cleans_before = len(module._clear_volatile_attrs.mock_calls)
        # Action
        module.charge = None
    def test_detached_module_none_to_free_charge(self):
        module = CachingModule(1, state=State.active, charge=None)
        charge = CachingCharge(2)
        module_cleans_before = len(module._clear_volatile_attrs.mock_calls)
        charge_cleans_before = len(charge._clear_volatile_attrs.mock_calls)
    def test_detached_module_charge_to_free_charge(self):
        module = CachingModule(1, state=State.active, charge=None)
        charge1 = CachingCharge(2)
        charge2 = CachingCharge(3)
        module.charge = charge1
    def test_detached_module_charge_to_none(self):
        module = CachingModule(1, state=State.active, charge=None)
        charge = CachingCharge(2)
        module.charge = charge
        module_cleans_before = len(module._clear_volatile_attrs.mock_calls)

src/e/o/Eos-HEAD/tests/fit/specials/test_state_switch.py   Eos(Download)
from eos.const.eos import State
from eos.fit.holder.container import HolderSet
from eos.tests.fit.environment import CachingModule
from eos.tests.fit.fit_testcase import FitTestCase
 
    def test_detached_upwards(self):
        fit = self.make_fit()
        holder = CachingModule(1, State.offline)
        fit.unordered.add(holder)
        st_cleans_before = len(fit.stats._clear_volatile_attrs.mock_calls)
    def test_detached_downwards(self):
        fit = self.make_fit()
        holder = CachingModule(1, State.overload)
        fit.unordered.add(holder)
        st_cleans_before = len(fit.stats._clear_volatile_attrs.mock_calls)
    def test_attached_upwards(self):
        eos = Mock(spec_set=())
        fit = self.make_fit(eos=eos)
        holder = CachingModule(1, State.offline)
        fit.unordered.add(holder)
    def test_attached_downwards(self):
        eos = Mock(spec_set=())
        fit = self.make_fit(eos=eos)
        holder = CachingModule(1, State.overload)
        fit.unordered.add(holder)