-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial TES integration test (Funnel)
- Loading branch information
1 parent
8a4d9d9
commit a69a458
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import unittest | ||
import tes | ||
|
||
|
||
class TestTESClient(unittest.TestCase): | ||
def setUp(self): | ||
self.cli = tes.HTTPClient("http://localhost:8000", timeout=5) | ||
self.task = tes.Task( | ||
executors=[ | ||
tes.Executor( | ||
image="alpine", | ||
command=["echo", "hello"] | ||
) | ||
] | ||
) | ||
|
||
def test_task_creation(self): | ||
# Test service info retrieval | ||
service_info = self.cli.get_service_info() | ||
self.assertIsNotNone(service_info) | ||
|
||
# Test task creation | ||
task_id = self.cli.create_task(self.task) | ||
self.assertIsNotNone(task_id) | ||
|
||
# Wait for task to complete | ||
_ = self.cli.wait(task_id) | ||
|
||
# Test task info retrieval | ||
task_info = self.cli.get_task(task_id, view="BASIC") | ||
self.assertIsNotNone(task_info) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |