From 1da15cfde358e0e89bf99fa77694861115f2b2d1 Mon Sep 17 00:00:00 2001 From: Ebag333 Date: Thu, 23 Mar 2017 11:10:53 -0700 Subject: [PATCH] Add right number of levels to remove. (cherry picked from commit 1d0a682) --- tests/test_modules/test_eos/test_gamedata.py | 2 +- .../test_modules/test_eos/test_modifiedAttributeDict.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/test_modules/test_eos/test_gamedata.py b/tests/test_modules/test_eos/test_gamedata.py index fa20aaa5e0..4a8674339c 100644 --- a/tests/test_modules/test_eos/test_gamedata.py +++ b/tests/test_modules/test_eos/test_gamedata.py @@ -3,7 +3,7 @@ import os import sys script_dir = os.path.dirname(os.path.abspath(__file__)) -sys.path.append(os.path.realpath(os.path.join(script_dir, '..', '..'))) +sys.path.append(os.path.realpath(os.path.join(script_dir, '..', '..', '..'))) # noinspection PyPackageRequirements from _development.helpers import DBInMemory as DB, Gamedata, Saveddata diff --git a/tests/test_modules/test_eos/test_modifiedAttributeDict.py b/tests/test_modules/test_eos/test_modifiedAttributeDict.py index afdf0163b3..d51f3459a5 100644 --- a/tests/test_modules/test_eos/test_modifiedAttributeDict.py +++ b/tests/test_modules/test_eos/test_modifiedAttributeDict.py @@ -4,7 +4,7 @@ import os import sys script_dir = os.path.dirname(os.path.abspath(__file__)) -sys.path.append(os.path.realpath(os.path.join(script_dir, '..', '..'))) +sys.path.append(os.path.realpath(os.path.join(script_dir, '..', '..', '..'))) # noinspection PyPackageRequirements from _development.helpers import DBInMemory as DB, Gamedata, Saveddata @@ -21,18 +21,21 @@ def test_multiply_stacking_penalties(DB, Saveddata, RifterFit): mod = Saveddata['Module'](DB['db'].getItem("EM Ward Amplifier II")) item_modifer = mod.item.getAttribute("emDamageResistanceBonus") - RifterFit.calculateModifiedAttributes() for _ in range(10): + # See: http://wiki.eveuniversity.org/Eve_Math#Stacking_Penalties current_effectiveness = pow(0.5, (pow(0.45 * (_ - 1), 2))) + RifterFit.clear() + RifterFit.calculateModifiedAttributes() + if _ == 0: + # First run we have no modules, se don't try and calculate them. calculated_resist = RifterFit.ship.getModifiedItemAttr("shieldEmDamageResonance") else: new_item_modifier = 1 + ((item_modifer * current_effectiveness) / 100) calculated_resist = (em_resist * new_item_modifier) - RifterFit.clear() RifterFit.modules.append(mod) RifterFit.calculateModifiedAttributes()