Skip to content

Commit

Permalink
Refs #9342 Add unit test for IndirectTransmission
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Jackson committed Jun 10, 2014
1 parent 4905337 commit 381ecde
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
Expand Up @@ -16,6 +16,7 @@ set ( TEST_PY_FILES
FilterLogByTimeTest.py
FindReflectometryLinesTest.py
GetEiT0atSNSTest.py
IndirectTransmissionTest.py
LoadFullprofFileTest.py
LoadLiveDataTest.py
LoadLogPropertyTableTest.py
Expand Down
@@ -0,0 +1,27 @@
import unittest
import numpy as np
import mantid.simpleapi
from mantid.simpleapi import IndirectTransmission

class IndirectTransmissionTest(unittest.TestCase):

def test_indirect_transmission(self):
instrument = "IRIS"
analyser = "graphite"
reflection = "002"

#using water sample
formula = "H2-O"
density = 0.1
thickness = 0.1

ws = IndirectTransmission(Instrument=instrument, Analyser=analyser, Reflection=reflection,
ChemicalFormula=formula, NumberDensity=density, Thickness=thickness)

#expected values from table
ref_result = [6.658, 0.821223, 2.58187, 53.5069, 56.0888, 0.1, 0.1, 0.566035, 0.429298]
values = ws.column(1)
np.testing.assert_allclose(values, ref_result, rtol=1e-5)

if __name__=="__main__":
unittest.main()

0 comments on commit 381ecde

Please sign in to comment.