예제 #1
0
    def test_get_result_path(self):
        """Tests nupack result path"""

        n = Nupack(InputHandler='_input_as_lines')
        res = n(self.input)
        self.assertEqualItems(res.keys(),['StdOut','StdErr','ExitStatus',
        'pair','ene'])
        assert res['pair'] is not None
        assert res['ene'] is not None
        res.cleanUp()
예제 #2
0
    def test_input_as_lines(self):
        """Test nupack input as lines"""

        n = Nupack(InputHandler='_input_as_lines')
        exp = '%s\n' % '\n'.join([str(i).strip('\n') for i in nupack_stdout])

        res = n(self.input)
        obs = res['StdOut'].read()
        self.assertEqual(obs,exp)
        res.cleanUp()
예제 #3
0
    def test_input_as_string(self):
        """Test nupack input as string"""

        n = Nupack()
        exp = '%s\n' % '\n'.join([str(i).strip('\n') for i in nupack_stdout])

        f = open('/tmp/single.fasta','w')
        txt = '\n'.join([str(i).strip('\n') for i in self.input])
        f.write(txt)
        f.close()
        res = n('/tmp/single.fasta')
        obs = res['StdOut'].read()
        self.assertEqual(obs,exp)
        res.cleanUp()
        remove('/tmp/single.fasta')