def __init__(self, parent, instance_name, status): BasicApp.__init__(self, parent, instance_name, status) self.code = "" self.__plot = None self.__plotter = Plotter(create_plot_function=self.create_plot, plot_ready_function=self.replot) self.q = Queue()
def setUp(self): self.dice = Dice() desk = Desk(parent=self.dice) self.dice.desk = desk home = Home(parent=self.dice) self.dice.home = home self.temp_dir = gettempdir() try: shutil.rmtree(os.path.join(self.temp_dir, "test_project")) except FileNotFoundError: pass self.dice.create_new_project("test_project", self.temp_dir, "description") # TODO: create TestDice unit test self.app = BasicApp(parent=None, instance_name="test_app", status=BasicApp.IDLE) self.app.setParent(self.dice.desk)
class TestApp(unittest.TestCase): temp_dir = "" dice = None app = None def setUp(self): self.dice = Dice() desk = Desk(parent=self.dice) self.dice.desk = desk home = Home(parent=self.dice) self.dice.home = home self.temp_dir = gettempdir() try: shutil.rmtree(os.path.join(self.temp_dir, "test_project")) except FileNotFoundError: pass self.dice.create_new_project("test_project", self.temp_dir, "description") # TODO: create TestDice unit test self.app = BasicApp(parent=None, instance_name="test_app", status=BasicApp.IDLE) self.app.setParent(self.dice.desk) def tearDown(self): shutil.rmtree(os.path.join(self.temp_dir, "test_project")) def test_config_file_written_when_status_changed(self): self.app.status = BasicApp.FINISHED app_dice = JsonOrderedDict(self.app.config_path("app.dice")) self.assertEqual(BasicApp.FINISHED, app_dice["General"]["status"]) def test_prepare_returns_true_by_default(self): self.assertTrue(self.app.prepare()) def test_run_returns_false_by_default(self): self.assertFalse(self.app.run())
def __init__(self, parent, instance_name, status): """ Constructor of bashTerminal :param parent: :param instance_name: :param status: :return: """ BasicApp.__init__(self, parent, instance_name, status) self.bash = subprocess.Popen(['/bin/bash'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) self.reader = BashIOReader(self.bash.stdout, self.emit_stdout, self.debug) self.reader.start() self.err_reader = BashIOReader(self.bash.stderr, self.emit_stdout, self.debug) self.err_reader.start()
def __init__(self, parent, instance_name, status): BasicApp.__init__(self, parent, instance_name, status) self.dakota_files = dict()