Archived
1
0

Added tests

This commit is contained in:
Harmen Prins 2014-06-12 12:50:20 +02:00
parent c0727a2ac7
commit ad8e3d07cd
2 changed files with 12 additions and 8 deletions

View File

@ -28,7 +28,7 @@ class ConfigImporter():
class GUI():
def __init__(self):
"""Boots the window, configuration."""
self.configurator = ConfigImporter(['GUI/gui.cfg','gui.cfg'])
self.configurator = ConfigImporter('GUI/gui.cfg')
self.finish_with_search = False
self.values = {}
self.window, self.variables = self.generate_window(self.load_common_attributes(), self.load_output_types())
@ -188,6 +188,4 @@ class GUI():
if self.finish_with_search:
self.execute_search()
else:
tkMessageBox.showinfo("Notice", "No search was executed!")
GUI().run()
tkMessageBox.showinfo("Notice", "No search was executed!")

View File

@ -12,8 +12,14 @@ class TestGUI(unittest.TestCase):
test_gui.prepare_search()
def test_no_configurations(self):
test_gui = gui.GUI()
#test_gui.
test_gui.run()
test_gui.prepare_search()
import os
config_name = 'gui.cfg'
with open(config_name) as config_file:
file_contents = config_file.read()
os.remove(config_name)
test_gui = gui.GUI()
test_gui.finish_with_search = True
test_gui.run()