示例#1
0
    def test_info(self):
        args = ['info', self.seq_file,
                '--out-file', self.tempfile.name,
                '--threads', str(self.threads)]

        cli.main(args)
        self.assertEquals(self.expected.format(self.seq_file), self.tempfile.read())
示例#2
0
 def test_convert_noformat(self):
     in_path = p('input2.fasta')
     cli.main(['convert', in_path, '-'])
     actual = self.out.getvalue()
     with open(in_path) as fp:
         expected = fp.read()
     self.assertEqual(expected, actual)
示例#3
0
 def test_convert_noformat(self):
     in_path = p('input2.fasta')
     cli.main(['convert', in_path, '-'])
     actual = self.out.getvalue()
     with open(in_path) as fp:
         expected = fp.read()
     self.assertEqual(expected, actual)
示例#4
0
    def test_description(self):
        args = ['extract-ids', os.path.join(data_dir, 'input1.fasta'),
                '-o', self.tempfile.name, '-d']
        cli.main(args)
        self.assertEquals("""test1 test sequence 1
test2 test sequence 2
test3 sequence 3
""", self.tempfile.read())
示例#5
0
    def test_simple(self):
        args = ['extract-ids', os.path.join(data_dir, 'input1.fasta'),
                '-o', self.tempfile.name]
        cli.main(args)
        self.assertEquals("""test1
test2
test3
""", self.tempfile.read())
示例#6
0
    def test_info(self):
        args = [
            'info', self.seq_file, '--out-file', self.tempfile.name,
            '--threads',
            str(self.threads)
        ]

        cli.main(args)
        self.assertEquals(self.expected.format(self.seq_file),
                          self.tempfile.read())
示例#7
0
    def test_run(self):
        command = self.command.format(input=self.input_file.name,
                output=self.output_file)
        cli.main(shlex.split(command))

        with FileType('r')(self.output_file) as fp:
            actual = fp.read()
        with FileType('r')(self.expected_path) as fp:
            expected = fp.read()
        self.assertEqual(expected, actual)
示例#8
0
    def test_run(self):
        command = self.command.format(input=self.input_file.name,
                                      output=self.output_file)
        cli.main(shlex.split(command))

        with FileType('r')(self.output_file) as fp:
            actual = fp.read()
        with FileType('r')(self.expected_path) as fp:
            expected = fp.read()
        self.assertEqual(expected, actual)
示例#9
0
    def test_run(self):
        command = self.command.format(input=self.input_file)
        try:
            cli.main(shlex.split(command))
        except SystemExit as e:
            self.fail(e)

        with FileType('rt')(self.input_file) as fp:
            actual = fp.read()
        with FileType('rt')(self.expected_path) as fp:
            expected = fp.read()
        self.assertEqual(expected, actual)
示例#10
0
    def test_run(self):
        command = self.command.format(input=self.input_file)
        try:
            cli.main(shlex.split(command))
        except SystemExit as e:
            self.fail(e)

        with FileType('rt')(self.input_file) as fp:
            actual = fp.read()
        with FileType('rt')(self.expected_path) as fp:
            expected = fp.read()
        self.assertEqual(expected, actual)
示例#11
0
 def test_descriptions(self):
     args = ['extract-ids', self.seq_file, '-o', self.tempfile.name, '-d']
     cli.main(args)
     self.assertEquals(self.expected_desc, self.tempfile.read())
示例#12
0
 def test_ids(self):
     args = ['extract-ids', self.seq_file, '-o', self.tempfile.name]
     cli.main(args)
     self.assertEquals(self.expected, self.tempfile.read())
示例#13
0
 def test_run(self):
     command = self.command.format(input=self.input_file)
     try:
         cli.main(shlex.split(command))
     except SystemExit, e:
         self.fail(e)
示例#14
0
 def test_ids(self):
     args = ['extract-ids', self.seq_file, '-o', self.tempfile.name]
     cli.main(args)
     self.assertEquals(self.expected, self.tempfile.read())
示例#15
0
 def test_run(self):
     command = self.command.format(input=self.input_file)
     try:
         cli.main(shlex.split(command))
     except SystemExit, e:
         self.fail(e)
示例#16
0
 def test_descriptions(self):
     args = ['extract-ids', self.seq_file, '-o', self.tempfile.name, '-d']
     cli.main(args)
     self.assertEquals(self.expected_desc, self.tempfile.read())
示例#17
0
#!/usr/bin/env python

import sys

if __name__ == '__main__':
    from seqmagick.scripts import cli
    sys.exit(cli.main(sys.argv[1:]))