Skip to content

Commit

Permalink
Re #10234. support property "PlotName"
Browse files Browse the repository at this point in the history
  • Loading branch information
yxqd committed Aug 31, 2015
1 parent c245d97 commit 4d5bb5f
Showing 1 changed file with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class SaveVulcanGSSTest(unittest.TestCase):
def test_save_one_curve(self):
""" Test to Save one curve
"""
datawsname = "TestOneSurve"
datawsname = "TestOneCurve"
E, I, err = self._createOneCurve(datawsname)

# Execute
Expand Down Expand Up @@ -94,6 +94,35 @@ def test_save_two_curves(self):
return


def test_save_one_curve_withdesignatedname(self):
""" Test to Save one curve with a name specified by client
"""
datawsname = "TestOneCurve"
E, I, err = self._createOneCurve(datawsname)

# Execute
out_path = "tempout_curve_withname.json"
alg_test = run_algorithm(
"Save1DPlottableAsJson",
InputWorkspace = datawsname,
JsonFilename = out_path,
PlotName = "myplot")

self.assertTrue(alg_test.isExecuted())

# Verify ....
d = json.load(open(out_path))
plotname = "myplot"
d0 = d[plotname+'0'] # plots are numbered
np.testing.assert_array_equal(d0['x'], E)
np.testing.assert_array_equal(d0['y'], I)
np.testing.assert_array_equal(d0['e'], err)

# Delete the output file
os.remove(out_path)
return


def _createOneCurve(self, datawsname):
""" Create data workspace
"""
Expand Down

0 comments on commit 4d5bb5f

Please sign in to comment.