Esempio n. 1
0
        def testOutputFileNoKeep (self):
                """Check correct output"""
                # First trimming from 0 to 20 without keeping
                trim_length.trimming(self.input, self.output, self.end, quiet=True)

                output = open (self.output, 'r')
                o_lines = output.read().split("\n")
                self.assertEqual(len(o_lines), 5)
                self.assertEqual (o_lines[1], self.first_0_20)
                self.assertEqual(o_lines[3], self.second_0_20)
                output.close()
                os.remove(self.output)
Esempio n. 2
0
        def testOutputFileKeep (self):
                """Check all keeping sequences and also shorter lines"""

                # Second trimming from 2 till 20
                trim_length.trimming(self.input, self.output2, self.end, start=2, keep=True, quiet=True)
                output = open (self.output2, 'r')
                o_lines = output.read().split("\n")
                self.assertEqual(len(o_lines), 7)
                self.assertEqual(o_lines[1], self.first_2_20)
                self.assertEqual (o_lines[3], self.second_2_20)
                self.assertEqual (o_lines[5], self.third_2_20_keep)
                output.close()
                os.remove(self.output2)