Skip to content

Commit

Permalink
fix string quotes (kubeflow#10413)
Browse files Browse the repository at this point in the history
  • Loading branch information
connor-mccarthy authored and petethegreat committed Mar 27, 2024
1 parent 7c97d31 commit a6420fd
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions sdk/python/kfp/cli/diagnose_me/utility_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,31 @@ class UtilityTest(unittest.TestCase):
def test_execute_command_oserror(self):
"""Testing stdout and stderr is correctly captured upon OSError."""
response = utility.ExecutorResponse()
err_msg = "Testing handling of OSError"
err_msg = 'Testing handling of OSError'

with patch("subprocess.run") as mock_run:
with patch('subprocess.run') as mock_run:
mock_run.side_effect = MagicMock(side_effect=OSError(err_msg))
response.execute_command([])

self.assertEqual(response._stdout, "")
self.assertEqual(response._stdout, '')
self.assertEqual(response._stderr, err_msg)

def test_execute_command_stdout(self):
"""Testing stdout output is correctly captured."""
test_string = "test string"
test_string = 'test string'
response = utility.ExecutorResponse()
response.execute_command(["echo", test_string])
response.execute_command(['echo', test_string])

self.assertEqual(response._stdout, test_string + "\n")
self.assertEqual(response._stderr, "")
self.assertEqual(response._stdout, test_string + '\n')
self.assertEqual(response._stderr, '')

def test_execute_command_stderr(self):
"""Testing stderr output is correctly captured."""
response = utility.ExecutorResponse()
response.execute_command(["ls", "not_a_real_dir"])
response.execute_command(['ls', 'not_a_real_dir'])

self.assertEqual(response._stdout, "")
self.assertIn("No such file", response._stderr)
self.assertEqual(response._stdout, '')
self.assertIn('No such file', response._stderr)

def test_parse_raw_input_json(self):
"""Testing json stdout is correctly parsed."""
Expand Down

0 comments on commit a6420fd

Please sign in to comment.