Initial pass at tests
This commit is contained in:
12
tests/test_modules/eos/test_mathUtils.py
Normal file
12
tests/test_modules/eos/test_mathUtils.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from eos.mathUtils import floorFloat
|
||||
|
||||
|
||||
def test_floorFloat():
|
||||
assert type(floorFloat(1)) is not float
|
||||
assert type(floorFloat(1)) is int
|
||||
assert type(floorFloat(1.1)) is not float
|
||||
assert type(floorFloat(1.1)) is int
|
||||
assert floorFloat(1.1) == 1
|
||||
assert floorFloat(1.9) == 1
|
||||
assert floorFloat(1.5) == 1
|
||||
assert floorFloat(-1.5) == -1
|
||||
8
tests/test_modules/gui/test_aboutData.py
Normal file
8
tests/test_modules/gui/test_aboutData.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from gui.aboutData import versionString, licenses, developers, credits, description
|
||||
|
||||
def test_aboutData():
|
||||
assert versionString.__len__() > 0
|
||||
assert licenses.__len__() > 0
|
||||
assert developers.__len__() > 0
|
||||
assert credits.__len__() > 0
|
||||
assert description.__len__() > 0
|
||||
41
tests/test_modules/service/test_attribute.py
Normal file
41
tests/test_modules/service/test_attribute.py
Normal file
@@ -0,0 +1,41 @@
|
||||
from service.attribute import Attribute
|
||||
|
||||
def test_attribute():
|
||||
"""
|
||||
We don't really have much to test here, to throw a generic attribute at it and validate we get the expected results
|
||||
|
||||
:return:
|
||||
"""
|
||||
sAttr = Attribute.getInstance()
|
||||
info = sAttr.getAttributeInfo("maxRange")
|
||||
|
||||
assert info.attributeID == 54
|
||||
assert type(info.attributeID) is int
|
||||
assert info.attributeName == 'maxRange'
|
||||
assert type(info.attributeName) is unicode
|
||||
assert info.defaultValue == 0.0
|
||||
assert type(info.defaultValue) is float
|
||||
assert info.description == 'Distance below which range does not affect the to-hit equation.'
|
||||
assert type(info.description) is unicode
|
||||
assert info.displayName == 'Optimal Range'
|
||||
assert type(info.displayName) is unicode
|
||||
assert info.highIsGood == True
|
||||
assert type(info.highIsGood) is bool
|
||||
assert info.iconID == 1391
|
||||
assert type(info.iconID) is int
|
||||
assert info.name == 'maxRange'
|
||||
assert type(info.name) is unicode
|
||||
assert info.published == True
|
||||
assert type(info.published) is bool
|
||||
assert info.unitID == 1
|
||||
assert type(info.unitID) is int
|
||||
assert info.unit.ID == 1
|
||||
assert type(info.unit.ID) is int
|
||||
assert info.unit.displayName == 'm'
|
||||
assert type(info.unit.displayName) is unicode
|
||||
assert info.unit.name == 'Length'
|
||||
assert type(info.unit.name) is unicode
|
||||
assert info.unit.unitID == 1
|
||||
assert type(info.unit.unitID) is int
|
||||
assert info.unit.unitName == 'Length'
|
||||
assert type(info.unit.unitName) is unicode
|
||||
Reference in New Issue
Block a user