Skip to content

Commit 2c90645

Browse files
author
Bihan Jiang
committed
add unit test for list jobs
1 parent cba4287 commit 2c90645

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tests/test_jobs.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
from pathlib import Path
2+
import time
3+
import pytest
4+
from nucleus import (
5+
AsyncJob,
6+
NucleusClient,
7+
)
8+
9+
10+
def test_reprs():
11+
# Have to define here in order to have access to all relevant objects
12+
def test_repr(test_object: any):
13+
assert eval(str(test_object)) == test_object
14+
15+
client = NucleusClient(api_key="fake_key")
16+
test_repr(
17+
AsyncJob(
18+
client=client,
19+
job_id="fake_job_id",
20+
job_last_known_status="fake_job_status",
21+
job_type="fake_job_type",
22+
job_creation_time="fake_job_creation_time",
23+
)
24+
)
25+
26+
27+
def test_job_creation_and_listing(CLIENT):
28+
jobs = CLIENT.list_jobs()
29+
30+
for job in jobs:
31+
assert eval(print(job)) == job

0 commit comments

Comments
 (0)