def test_get_protection_values(self): """ Protection values should include Protection runs. """ dso = DataStealOrder( stealer_corporation=self.c2, player=self.p, target_corporation=self.c, additional_percents=7, ) dso.save() self.assertEqual(dso.get_protection_values(), [dso.target_corporation.base_corporation.datasteal]) po = ProtectionOrder( player=self.p, protected_corporation=self.c, defense=ProtectionOrder.DATASTEAL, hidden_percents=10, ) po.save() self.assertEqual(dso.get_protection_values(), [ po.get_success_probability(), dso.target_corporation.base_corporation.datasteal ])
def test_has_base_value(self): """ Protection has defaut protection values """ po = ProtectionOrder( player=self.p, protected_corporation=self.c, defense=ProtectionOrder.DATASTEAL, additional_percents=1, ) po.save() self.assertEqual( po.get_success_probability(), po.additional_percents * 10 + po.BASE_SUCCESS_PROBABILITY[po.defense])