Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1e093d0

Browse files
authored
Update watch_test.py
Changes made to check whether entire log is printed or not.
1 parent1268769 commit1e093d0

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

‎kubernetes/base/watch/watch_test.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,9 +540,9 @@ def test_pod_log_empty_lines(self):
540540
#Mock logs used for this test
541541
w.stream=Mock(return_value=[
542542
"Hello from Docker",
543-
"\n",# Empty line
543+
"",# Empty line
544544
"Another log line",
545-
"\n",# Another empty line
545+
"",# Another empty line
546546
"Final log"
547547
])
548548
foreventinw.stream(self.api.read_namespaced_pod_log,name=pod_name,namespace=self.namespace,follow=True):
@@ -552,7 +552,16 @@ def test_pod_log_empty_lines(self):
552552
# Print outputs
553553
print(f"Captured logs:{log_output}")
554554
# self.assertTrue(any("Hello from Docker" in line for line in log_output))
555-
self.assertTrue(any(line.strip()==""forlineinlog_output),"No empty lines found in logs")
555+
# self.assertTrue(any(line.strip() == "" for line in log_output), "No empty lines found in logs")
556+
expected_log= [
557+
"Hello from Docker",
558+
"",
559+
"Another log line",
560+
"",
561+
"Final log"
562+
]
563+
564+
self.assertEqual(log_output,expected_log,"Captured logs do not match expected logs")
556565

557566
exceptApiExceptionase:
558567
self.fail(f"Kubernetes API exception:{e}")

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp