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

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

src/e/o/Eos-HEAD/tests/restriction_tracker/restrictions/test_rig_slot.py   Eos(Download)
 
from eos.const.eos import Location, Restriction, State
from eos.fit.holder.item import Implant, Rig
from eos.tests.restriction_tracker.restriction_testcase import RestrictionTestCase
 
    def test_fail_excess_signle(self):
        # Check that error is raised when number of used
        # slots exceeds slot amount provided by ship
        item = self.ch.type_(type_id=1)
        holder = Mock(state=State.offline, item=item, _location=Location.ship, spec_set=Rig(1))
    def test_fail_excess_signle_undefined_output(self):
        # When stats module does not specify total slot amount,
        # make sure it's assumed to be 0
        item = self.ch.type_(type_id=1)
        holder = Mock(state=State.offline, item=item, _location=Location.ship, spec_set=Rig(1))
    def test_fail_excess_multiple(self):
        # Check that error works for multiple holders
        item = self.ch.type_(type_id=1)
        holder1 = Mock(state=State.offline, item=item, _location=Location.ship, spec_set=Rig(1))
        holder2 = Mock(state=State.offline, item=item, _location=Location.ship, spec_set=Rig(1))

src/e/o/Eos-HEAD/tests/restriction_tracker/restrictions/test_calibration.py   Eos(Download)
from eos.const.eos import Location, Restriction, State
from eos.const.eve import Attribute
from eos.fit.holder.item import Rig, Implant
from eos.tests.restriction_tracker.restriction_testcase import RestrictionTestCase
 
    def test_fail_excess_single(self):
        # When ship provides calibration output, but single consumer
        # demands for more, error should be raised
        item = self.ch.type_(type_id=1, attributes={Attribute.upgrade_cost: 0})
        holder = Mock(state=State.offline, item=item, _location=Location.ship, spec_set=Rig(1))
    def test_fail_excess_single_undefined_output(self):
        # When stats module does not specify output, make sure
        # it's assumed to be 0
        item = self.ch.type_(type_id=1, attributes={Attribute.upgrade_cost: 0})
        holder = Mock(state=State.offline, item=item, _location=Location.ship, spec_set=Rig(1))
        # be erroneous situation
        item = self.ch.type_(type_id=1, attributes={Attribute.upgrade_cost: 0})
        holder1 = Mock(state=State.offline, item=item, _location=Location.ship, spec_set=Rig(1))
        holder1.attributes = {Attribute.upgrade_cost: 25}
        self.track_holder(holder1)
        holder2 = Mock(state=State.offline, item=item, _location=Location.ship, spec_set=Rig(1))

src/e/o/Eos-HEAD/tests/restriction_tracker/restrictions/test_rig_size.py   Eos(Download)
from eos.const.eos import Location, Restriction, State
from eos.const.eve import Attribute
from eos.fit.holder.item import Rig, Ship
from eos.tests.restriction_tracker.restriction_testcase import RestrictionTestCase
 
    def test_fail_mismatch(self):
        # Error should be raised when mismatching rig size
        # is added to ship
        item = self.ch.type_(type_id=1, attributes={Attribute.rig_size: 10})
        holder = Mock(state=State.offline, item=item, _location=Location.ship, spec_set=Rig(1))
    def test_fail_original(self):
        # Original value must be taken
        item = self.ch.type_(type_id=1, attributes={Attribute.rig_size: 10})
        holder = Mock(state=State.offline, item=item, _location=Location.ship, spec_set=Rig(1))
        holder.attributes = {Attribute.rig_size: 5}
    def test_pass_no_ship(self):
        # When no ship is assigned, no restriction
        # should be applied to ships
        item = self.ch.type_(type_id=1, attributes={Attribute.rig_size: 10})
        holder = Mock(state=State.offline, item=item, _location=Location.ship, spec_set=Rig(1))
    def test_pass_ship_no_attr(self):
        # If ship doesn't have rig size attribute,
        # no restriction is applied onto rigs
        item = self.ch.type_(type_id=1, attributes={Attribute.rig_size: 10})
        holder = Mock(state=State.offline, item=item, _location=Location.ship, spec_set=Rig(1))