Skip to content

Commit

Permalink
fixed typos
Browse files Browse the repository at this point in the history
  • Loading branch information
ZohebShaikh committed Sep 6, 2024
1 parent 96ffe70 commit d608a06
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/blueapi/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,15 @@ def get_task(self, task_id: str) -> TrackableTask[Task]:
assert task_id != "", "Task ID cannot be empty"
return self._rest.get_task(task_id)

def get_all_task(self) -> TasksListResponse:
def get_all_tasks(self) -> TasksListResponse:
"""
Get a list of all task stored by the worker
Returns:
TasksListResponse: List of all Trackable Task
"""

return self._rest.get_all_task()
return self._rest.get_all_tasks()

def get_active_task(self) -> WorkerTask:
"""
Expand Down
2 changes: 1 addition & 1 deletion src/blueapi/client/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def set_state(
def get_task(self, task_id: str) -> TrackableTask[Task]:
return self._request_and_deserialize(f"/tasks/{task_id}", TrackableTask[Task])

def get_all_task(self) -> TasksListResponse:
def get_all_tasks(self) -> TasksListResponse:
return self._request_and_deserialize("/tasks", TasksListResponse)

Check warning on line 75 in src/blueapi/client/rest.py

View check run for this annotation

Codecov / codecov/patch

src/blueapi/client/rest.py#L75

Added line #L75 was not covered by tests

def get_active_task(self) -> WorkerTask:
Expand Down
4 changes: 2 additions & 2 deletions tests/system_tests/test_blueapi_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def test_get_all_tasks(client: BlueapiClient):
created_tasks.append(created_task)
task_ids = [task.task_id for task in created_tasks]

task_list = client.get_all_task()
task_list = client.get_all_tasks()
for trackable_task in task_list.tasks:
assert trackable_task.task_id in task_ids
assert trackable_task.is_complete is False and trackable_task.is_pending is True
Expand Down Expand Up @@ -212,7 +212,7 @@ def test_get_task_by_status(client: BlueapiClient):
client.clear_task(task_id=task_2.task_id)


def test_progress_wit_stomp(client_with_stomp: BlueapiClient):
def test_progress_with_stomp(client_with_stomp: BlueapiClient):
all_events: list[AnyEvent] = []

def on_event(event: AnyEvent):
Expand Down
4 changes: 2 additions & 2 deletions tests/unit_tests/client/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def mock_rest() -> BlueapiRestClient:
mock.get_device.return_value = DEVICE
mock.get_state.return_value = WorkerState.IDLE
mock.get_task.return_value = TASK
mock.get_all_task.return_value = TASKS
mock.get_all_tasks.return_value = TASKS
mock.get_active_task.return_value = ACTIVE_TASK
mock.get_environment.return_value = ENV
mock.delete_environment.return_value = EnvironmentResponse(initialized=False)
Expand Down Expand Up @@ -154,7 +154,7 @@ def test_get_task_with_empty_id(client: BlueapiClient):
def test_get_all_tasks(
client: BlueapiClient,
):
assert client.get_all_task() == TASKS
assert client.get_all_tasks() == TASKS


def test_create_task(
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/service/test_rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ def test_get_task(get_task_by_id: MagicMock, client: TestClient):


@patch("blueapi.service.interface.get_tasks")
def test_get_all_task(get_all_tasks: MagicMock, client: TestClient):
def test_get_all_tasks(get_all_tasks: MagicMock, client: TestClient):
task_id = str(uuid.uuid4())
tasks = [
TrackableTask(
Expand Down

0 comments on commit d608a06

Please sign in to comment.