def test_return_failure_code_missing_param_negative(self): try: stringparse.main(['']) except SystemExit as e: self.assertEqual(e.code, 2)
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']")
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']")
def test_return_correct_transform_file_positive(self): self.assertEqual(stringparse.main(['', 'ConsecutiveChars', 'array_of_strings.txt']), 0)
def test_return_correct_transform_direct_positive(self): self.assertEqual(stringparse.main(['', 'ConsecutiveChars', 'abXyz,befgh,cFvwX,DGjhY']), 0)