Write a simple python hello world #5
@@ -0,0 +1,8 @@
|
||||
# Python bytecode
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
# Distribution / packaging
|
||||
dist/
|
||||
build/
|
||||
*.egg-info/
|
||||
Binary file not shown.
+3
-2
@@ -1,5 +1,6 @@
|
||||
import subprocess
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
class TestHello(unittest.TestCase):
|
||||
@@ -9,7 +10,7 @@ class TestHello(unittest.TestCase):
|
||||
["python3", "hello.py"],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
cwd="/workspace"
|
||||
cwd=Path(__file__).parent
|
||||
)
|
||||
self.assertEqual(result.returncode, 0)
|
||||
self.assertIn("Hello, World!", result.stdout)
|
||||
@@ -20,7 +21,7 @@ class TestHello(unittest.TestCase):
|
||||
["python3", "hello.py"],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
cwd="/workspace"
|
||||
cwd=Path(__file__).parent
|
||||
)
|
||||
self.assertEqual(result.stderr, "")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user