def test_get_result_path(self): """Tests rnaforester result path""" r = RNAforester(InputHandler='_input_as_lines') res = r(self.input) self.assertEqualItems(res.keys(), ['StdOut', 'StdErr', 'ExitStatus']) self.assertEqual(res['ExitStatus'], 0) assert res['StdOut'] is not None res.cleanUp()
def test_stdout_input_as_lines(self): """Test rnaforester stdout input as lines""" r = RNAforester(InputHandler='_input_as_lines') exp = '%s\n' % '\n'.join( [str(i).strip('\n') for i in rnaforester_stdout]) res = r(self.input) obs = res['StdOut'].read() self.assertEqual(obs, exp) res.cleanUp()
def test_stdout_input_as_string(self): """Test rnaforester stdout input as string""" r = RNAforester() exp = '%s\n' % '\n'.join( [str(i).strip('\n') for i in rnaforester_stdout]) f = open('/tmp/input.fasta', 'w') txt = '\n'.join([str(i).strip('\n') for i in self.input]) f.write(txt) f.close() res = r('/tmp/input.fasta') obs = res['StdOut'].read() self.assertEqual(obs, exp) res.cleanUp() remove('/tmp/input.fasta')