agent: Write a simple python hello world Iteration 2
This commit is contained in:
@@ -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 subprocess
|
||||||
import unittest
|
import unittest
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
class TestHello(unittest.TestCase):
|
class TestHello(unittest.TestCase):
|
||||||
@@ -9,7 +10,7 @@ class TestHello(unittest.TestCase):
|
|||||||
["python3", "hello.py"],
|
["python3", "hello.py"],
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
text=True,
|
text=True,
|
||||||
cwd="/workspace"
|
cwd=Path(__file__).parent
|
||||||
)
|
)
|
||||||
self.assertEqual(result.returncode, 0)
|
self.assertEqual(result.returncode, 0)
|
||||||
self.assertIn("Hello, World!", result.stdout)
|
self.assertIn("Hello, World!", result.stdout)
|
||||||
@@ -20,7 +21,7 @@ class TestHello(unittest.TestCase):
|
|||||||
["python3", "hello.py"],
|
["python3", "hello.py"],
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
text=True,
|
text=True,
|
||||||
cwd="/workspace"
|
cwd=Path(__file__).parent
|
||||||
)
|
)
|
||||||
self.assertEqual(result.stderr, "")
|
self.assertEqual(result.stderr, "")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user