def assign_outputs(self): for node in self.output_nodes: if node.type == 'TEXT': text = read_text(node.filename()) node.value = text else: node.value = 'executed'
def setup(self, inputfiles): input_nodes = [node for node in self.input_nodes if node.value == None] if len(input_nodes) != len(inputfiles): raise RuntimeError('Invalid number of input files provided: expected {0}, got {1}'.format(len(input_nodes), len(inputfiles))) for i in range(len(inputfiles)): shutil.copy(inputfiles[i], self.input_nodes[i].filename()) self.input_nodes[i].value = read_text(inputfiles[i])
def setup(self, inputfiles): input_nodes = [node for node in self.input_nodes if node.value is None] if len(input_nodes) != len(inputfiles): raise RuntimeError('Invalid number of input files provided: expected {0}, got {1}'.format(len(input_nodes), len(inputfiles))) for i in range(len(inputfiles)): shutil.copy(inputfiles[i], self.input_nodes[i].filename()) self.input_nodes[i].value = read_text(inputfiles[i])
def dump_file_contents(self): filenames = [node.filename() for node in self.nodes] for file in filenames: if os.path.exists(file) and (file.endswith('.mcrl2spec') or file.endswith('.pbesspec') or file.endswith('.statefrm')): contents = read_text(file) print('Contents of file {}:\n{}'.format(file, contents))
def run_yml_test(name, testfile, inputfiles, settings): for filename in [testfile] + inputfiles: if not os.path.isfile(filename): print('Error:', filename, 'does not exist!') return t = Test(testfile, settings) if 'verbose' in settings and settings['verbose']: print 'Running test ' + testfile t.setup(inputfiles) result = t.run() print name, result if result == False: for filename in inputfiles: text = read_text(filename) print '- file {}\n{}\n'.format(filename, text) return result
def assign_outputs(self): text = read_text(self.output_nodes[0].filename()) self.output_nodes[0].value = text