Skip to content

Commit

Permalink
Add tests for EnableLogging keyword support. Refs #6208
Browse files Browse the repository at this point in the history
  • Loading branch information
martyngigg committed Nov 20, 2012
1 parent 08fa89f commit 3d9148a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,16 @@ def test_other_arguments_are_accepted_by_keyword(self):
if platform.system() == 'Darwin': # crashes
return
output_name = "otherargs_fitWS"
retvals = Fit("name=FlatBackground", self._raw_ws, MaxIterations=10, Output=output_name)
retvals = Fit("name=FlatBackground", self._raw_ws, MaxIterations=2, Output=output_name)
self._check_returns_are_correct_type_with_workspaces(retvals)
self.assertTrue(output_name + '_Workspace' in mtd)

def test_Fit_accepts_EnableLogging_keyword(self):
if platform.system() == 'Darwin': # crashes
return
output_name = "otherargs_fitWS"
retvals = Fit("name=FlatBackground", self._raw_ws, MaxIterations=2, Output=output_name,EnableLogging=False)
self.assertTrue(output_name + '_Workspace' in mtd)

def _check_returns_are_correct_type_with_workspaces(self, retvals):
self.assertEquals(len(retvals), 5)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,15 @@ def test_Load_call_with_args_that_do_not_apply_executes_correctly(self):

def test_Load_uses_OutputWorkspace_keyword_over_lhs_var_name_if_provided(self):
wsname = 'test_Load_uses_OutputWorkspace_keyword_over_lhs_var_name_if_provided'
data = [1.0,2.0,3.0,4.0,5.0]
wkspace = Load('IRS21360.raw',OutputWorkspace=wsname)
self.assertTrue( wsname in mtd )

def test_Load_accepts_EnableLogging_keyword(self):
# The test here is that the algorithm runs without falling over about the EnableLogging keyword being a property
wsname = 'test_Load_accepts_EnableLogging_keyword'
Load('IRS21360.raw',OutputWorkspace=wsname, EnableLogging=False)
self.assertTrue( wsname in mtd )

def test_that_dialog_call_raises_runtime_error(self):
try:
LoadDialog()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ def test_function_call_executes_when_algorithm_has_only_inout_workspace_props(se
wavelength = simpleapi.CreateWorkspace(data,data,NSpec=3,UnitX='Wavelength')
simpleapi.MaskDetectors(wavelength,WorkspaceIndexList=[1,2])

def test_function_accepts_EnableLogging_keyword(self):
# The test here is that the algorithm runs without falling over about the EnableLogging keyword being a property
wsname = 'test_function_call_executes_correct_algorithm_when_passed_correct_args'
data = [1.0,2.0,3.0,4.0,5.0]
simpleapi.CreateWorkspace(data,data,OutputWorkspace=wsname,NSpec=1,UnitX='Wavelength',EnableLogging=False)
self.assertTrue( wsname in mtd )

def test_function_call_raises_ValueError_when_passed_args_with_invalid_values(self):
# lhs code bug means we can't do this "self.assertRaises(simpleapi.LoadNexus, 'DoesNotExist')" --> ticket #4186
try:
Expand Down

0 comments on commit 3d9148a

Please sign in to comment.