-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_merge.t
executable file
·77 lines (51 loc) · 2.16 KB
/
test_merge.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import tempfile
import shutil
from simpletap.motus import MotusTestCase
class TestMerge(MotusTestCase):
def test_normal_multiple(self):
"motus merge with multiple profiles"
cmd = ("merge",
"-i", ",".join([
"sample_data/ERR878216_single_1.profile",
"sample_data/ERR878216_single_2.profile",
]))
stdout, stderr, exit = self.run_motus(cmd)
self.validate_result(stdout, "sample_data/ERR878216_single_merge_1_2.profile")
def test_normal_single(self):
"motus merge with single profile"
cmd = ("merge",
"-i", "sample_data/ERR878216_single_1.profile")
stdout, stderr, exit = self.run_motus(cmd)
self.validate_result(stdout, "sample_data/ERR878216_single_1.profile")
class TestSingleMergeDirectory(MotusTestCase):
def setUp(self):
self.tmpdir = tempfile.mkdtemp()
shutil.copy("sample_data/ERR878216_single_1.profile", self.tmpdir)
def tearDown(self):
shutil.rmtree(self.tmpdir, ignore_errors=True)
def test_normal_single(self):
"motus merge with single profile in a directory"
cmd = ("merge",
"-d", self.tmpdir)
stdout, stderr, exit = self.run_motus(cmd)
self.validate_result(stdout, "sample_data/ERR878216_single_1.profile")
class TestMultipleMergeDirectory(MotusTestCase):
def setUp(self):
self.tmpdir = tempfile.mkdtemp()
shutil.copy("sample_data/ERR878216_single_1.profile", self.tmpdir)
shutil.copy("sample_data/ERR878216_single_2.profile", self.tmpdir)
def tearDown(self):
shutil.rmtree(self.tmpdir, ignore_errors=True)
def test_normal_multiple(self):
"motus merge with multiple profiles in a directory"
cmd = ("merge",
"-d", self.tmpdir)
stdout, stderr, exit = self.run_motus(cmd)
self.validate_result(stdout, "sample_data/ERR878216_single_merge_1_2.profile")
if __name__ == "__main__":
from simpletap import TAPTestRunner
unittest.main(testRunner=TAPTestRunner())
# vim: ai sts=4 et sw=4