def test_should_stop_on_termination_statement(self): tester = ComponentTester() tester.resetTerminationStatements() tester.addTerminationStatement('ERROR') tester.start('data/SequenceViewer.xml') time.sleep(.500) output = tester.getOutput() assert_that(output, contains_string('Finishing DisCODe.')) assert_that(output, contains_string('Server stoped.'))
def test_should_run_discode(self): tester = ComponentTester() tester.resetTerminationStatements() if isfile(self.defaultFileName): call(['rm', self.defaultFileName]) tester.start() output = tester.getOutput() assert_that(output, contains_string('\x1b[33mWARNING: \x1b[00mConfiguration file config.xml not found.\n'))
def test_should_stop_discode_manually(self): tester = ComponentTester() tester.resetTerminationStatements() tester.start() time.sleep(5) tester.stop() output = tester.getOutput() assert_that(output, contains_string('Finishing DisCODe.')) assert_that(output, contains_string('Server stoped.'))
def test_should_run_specific_task(self): tester = ComponentTester() tester.resetTerminationStatements() tester.taskName = 'SequenceViewer.xml' tester.start() time.sleep(.500) tester.runner.kill() output = tester.getOutput() assert_that(output, contains_string('Kopiowanie TASKA!'))
def test_should_run_task_with_default_name(self): tester = ComponentTester() tester.resetTerminationStatements() print(call(['pwd'])) if isfile(self.defaultFileName): call(['rm', self.defaultFileName]) tester.start() output = tester.getOutput() assert_that(output, contains_string('Configuration: File \'' + self.defaultFileName + '\' doesn\'t exist.'))