Esempio n. 1
0
 def test_pass_non_booster(self):
     item = self.ch.type_(type_id=1)
     holder = Mock(state=State.offline, item=item, _domain=Domain.character, spec=Implant(1))
     holder.side_effects = {55, 66}
     holder._disabled_effects = {77, 99}
     self.track_holder(holder)
     restriction_error = self.get_restriction_error(holder, Restriction.booster_effect)
     self.assertIsNone(restriction_error)
     self.untrack_holder(holder)
     self.assertEqual(len(self.log), 0)
     self.assert_restriction_buffers_empty()
Esempio n. 2
0
 def test_pass_enabled_regular_effect(self):
     item = self.ch.type_(type_id=1)
     holder = Mock(state=State.offline, item=item, _domain=Domain.character, spec_set=Booster(1))
     # Enabled regular effects are not listed in any of
     # these containers
     holder.side_effects = {}
     holder._disabled_effects = set()
     self.track_holder(holder)
     restriction_error = self.get_restriction_error(holder, Restriction.booster_effect)
     self.assertIsNone(restriction_error)
     self.untrack_holder(holder)
     self.assertEqual(len(self.log), 0)
     self.assert_restriction_buffers_empty()
Esempio n. 3
0
 def test_fail(self):
     # Check if error is raised when there's disabled effect
     item = self.ch.type_(type_id=1)
     holder = Mock(state=State.offline, item=item, _domain=Domain.character, spec_set=Booster(1))
     holder.side_effects = {55, 66}
     holder._disabled_effects = {77, 99}
     self.track_holder(holder)
     restriction_error = self.get_restriction_error(holder, Restriction.booster_effect)
     self.assertIsNotNone(restriction_error)
     self.assertEqual(restriction_error.illegally_disabled, {77, 99})
     self.assertEqual(restriction_error.disablable, {55, 66})
     self.untrack_holder(holder)
     self.assertEqual(len(self.log), 0)
     self.assert_restriction_buffers_empty()