Skip to content
Merged
4 changes: 2 additions & 2 deletions scaleapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def tasks(self, **kwargs) -> Tasklist:

def get_tasks(
self,
project_name: str,
project_name: str = None,
batch_name: str = None,
task_type: TaskType = None,
status: TaskStatus = None,
Expand Down Expand Up @@ -548,7 +548,7 @@ def get_tasks_count(

@staticmethod
def _process_tasks_endpoint_args(
project_name: str,
project_name: str = None,
batch_name: str = None,
task_type: TaskType = None,
status: TaskStatus = None,
Expand Down
2 changes: 1 addition & 1 deletion scaleapi/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "2.15.10"
__version__ = "2.15.11"
__package_name__ = "scaleapi"
16 changes: 16 additions & 0 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,3 +503,19 @@ def test_list_teammates():
# assert len(new_teammates) >= len(
# old_teammates
# ) # needs to sleep for teammates list to be updated

def test_get_tasks_without_project_name():
tasks = client.get_tasks()
assert isinstance(tasks, list)

def test_get_tasks_with_optional_project_name():
tasks = client.get_tasks(project_name=None)
assert isinstance(tasks, list)

def test_process_tasks_endpoint_args_without_project_name():
args = client._process_tasks_endpoint_args()
assert args["project_name"] is None

def test_process_tasks_endpoint_args_with_optional_project_name():
args = client._process_tasks_endpoint_args(project_name=None)
assert args["project_name"] is None