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

All Samples(8)  |  Call(6)  |  Derive(0)  |  Import(2)

src/e/o/Eos-HEAD/tests/attribute_calculator/modifier_location/direct/test_other.py   Eos(Download)
from eos.data.cache_object.modifier import Modifier
from eos.tests.attribute_calculator.attrcalc_testcase import AttrCalcTestCase
from eos.tests.attribute_calculator.environment import ChargeHolder, ContainerHolder, IndependentItem
 
 
    def test_other_location_container(self):
        influence_source = ContainerHolder(self.ch.type_(type_id=1, effects=(self.effect,),
                                           attributes={self.src_attr.id: 20}))
        self.fit.items.add(influence_source)
        influence_target = ChargeHolder(self.ch.type_(type_id=2, attributes={self.tgt_attr.id: 100}))
    def test_other_location_charge(self):
        influence_source = ChargeHolder(self.ch.type_(type_id=1, effects=(self.effect,),
                                        attributes={self.src_attr.id: 20}))
        self.fit.items.add(influence_source)
        influence_target = ContainerHolder(self.ch.type_(type_id=2, attributes={self.tgt_attr.id: 100}))
                                           attributes={self.tgt_attr.id: 100, self.src_attr.id: 20}))
        self.fit.items.add(influence_source)
        influence_target = ChargeHolder(self.ch.type_(type_id=2, attributes={self.tgt_attr.id: 100}))
        influence_source.charge = influence_target
        influence_target.container = influence_source

src/e/o/Eos-HEAD/tests/attribute_calculator/modifier_location/direct/disabled_links/test_other.py   Eos(Download)
from eos.data.cache_object.modifier import Modifier
from eos.tests.attribute_calculator.attrcalc_testcase import AttrCalcTestCase
from eos.tests.attribute_calculator.environment import ChargeHolder, ContainerHolder
 
 
        self.fit.items.add(influence_source)
        item = self.ch.type_(type_id=2, attributes={self.tgt_attr.id: 100})
        influence_target1 = ChargeHolder(item)
        influence_source.charge = influence_target1
        influence_target1.container = influence_source
        self.fit.items.add(influence_target1)
        self.assertNotAlmostEqual(influence_target1.attributes[self.tgt_attr.id], 100)
        self.fit.items.remove(influence_target1)
        influence_target2 = ChargeHolder(item)
    def test_other_charge(self):
        influence_source = ChargeHolder(self.ch.type_(type_id=1, effects=(self.effect,),
                                                      attributes={self.src_attr.id: 20}))
        self.fit.items.add(influence_source)
        item = self.ch.type_(type_id=2, attributes={self.tgt_attr.id: 100})