Skip to content
Snippets Groups Projects
Commit 2ce4dcdc authored by Vriezen, E.C. (Emma)'s avatar Vriezen, E.C. (Emma)
Browse files

Updated the test so that it accounts for the dynamic file output naming.

parent 0f51340f
No related branches found
No related tags found
3 merge requests!128master into SC-175/sunken_buttons_workaround,!117Sc203/switch algs,!115Sc204/alg in output
This commit is part of merge request !115. Comments created here will be created in the context of that merge request.
......@@ -2,6 +2,7 @@ import unittest
import unittest.mock as mock
from ..controller import Controller
import pyfakefs
from time import localtime, strftime
class ControllerTest(pyfakefs.fake_filesystem_unittest.TestCase):
......@@ -109,8 +110,13 @@ class ControllerTest(pyfakefs.fake_filesystem_unittest.TestCase):
controller._filewriter = fw
controller._save_results()
view.ask_save_location.assert_called()
fw.write_frame.assert_has_calls([mock.call("baz/bar/yit", "bar", "mistakes.csv"),
mock.call("baz/bar/yit", "foo", "delay.csv")])
algorithm = model.last_used_algorithm()
time = strftime("%d%m%y_%H%M%S", localtime())
title1 = "mistakes_{}_{}.csv".format(algorithm, time)
time = strftime("%d%m%y_%H%M%S", localtime())
title2 = "delay_{}_{}.csv".format(algorithm, time)
fw.write_frame.assert_has_calls([mock.call("baz/bar/yit", "bar", title1),
mock.call("baz/bar/yit", "foo", title2)])
view.update_message.assert_called_with("saved")
def test_select_folder(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment