Skip to content

Commit

Permalink
Clean up test structure a bit
Browse files Browse the repository at this point in the history
(cherry picked from commit 320e05b)
  • Loading branch information
Ebag333 committed Mar 24, 2017
1 parent 1da15cf commit 55cd0d5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
21 changes: 13 additions & 8 deletions tests/test_modules/test_eos/test_modifiedAttributeDict.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
import os
import sys
script_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.realpath(os.path.join(script_dir, '..', '..', '..')))
script_dir = os.path.realpath(os.path.join(script_dir, '..', '..', '..'))
print script_dir
sys.path.append(script_dir)

# noinspection PyPackageRequirements
from _development.helpers import DBInMemory as DB, Gamedata, Saveddata
Expand All @@ -22,22 +24,25 @@ 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:
# Calculate what our next resist should be
# See: http://wiki.eveuniversity.org/Eve_Math#Stacking_Penalties
current_effectiveness = pow(0.5, (pow(0.45 * (_ - 1), 2)))
new_item_modifier = 1 + ((item_modifer * current_effectiveness) / 100)
calculated_resist = (em_resist * new_item_modifier)

# Add another resist module to our fit.
RifterFit.modules.append(mod)
RifterFit.calculateModifiedAttributes()

# Modify our fit so that Eos generates new numbers for us.
RifterFit.clear()
RifterFit.calculateModifiedAttributes()

em_resist = RifterFit.ship.getModifiedItemAttr("shieldEmDamageResonance")

Expand Down
2 changes: 1 addition & 1 deletion tests/test_modules/test_gui/test_aboutData.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
script_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.realpath(os.path.join(script_dir, '..', '..', '..')))


from gui.aboutData import versionString, licenses, developers, credits, description


def test_aboutData():
"""
Simple test to validate all about data exists
Expand Down

0 comments on commit 55cd0d5

Please sign in to comment.