Ejemplo n.º 1
0
 def test_return_failure_code_missing_param_negative(self):
     try:
         stringparse.main([''])
     except SystemExit as e:
         self.assertEqual(e.code, 2)
Ejemplo n.º 2
0
    def test_stdout_correct_transform_file_positive(self):
        with captured_output() as (out, err):
            stringparse.main(['', 'ConsecutiveChars', 'test_files/array_of_strings.txt'])

        output = out.getvalue().strip()
        self.assertEqual(output, "['ab', 'yz', 'efgh', 'vw', 'abc', 'DE', 'FG', 'XY']")
Ejemplo n.º 3
0
    def test_stdout_correct_transform_direct_positive(self):
        with captured_output() as (out, err):
            stringparse.main(['', 'ConsecutiveChars', 'abXyz,befgh,cFvwX,DGjhY'])

        output = out.getvalue().strip()
        self.assertEqual(output, "['ab', 'yz', 'efgh', 'vw', 'abc', 'FG', 'XY']")
Ejemplo n.º 4
0
 def test_return_correct_transform_file_positive(self):
     self.assertEqual(stringparse.main(['', 'ConsecutiveChars', 'array_of_strings.txt']), 0)
Ejemplo n.º 5
0
 def test_return_correct_transform_direct_positive(self):
     self.assertEqual(stringparse.main(['', 'ConsecutiveChars', 'abXyz,befgh,cFvwX,DGjhY']), 0)