Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sdk): fix string quotes #10413

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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