Skip to content
Snippets Groups Projects

Sc204/alg in output

Merged Ghost User requested to merge SC204/alg-in-output into SC203/switch-algs
1 file
+ 8
2
Compare changes
  • Side-by-side
  • Inline
@@ -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):
Loading