Skip to content

Commit

Permalink
feat: add endpoint for getting the Proxy settings
Browse files Browse the repository at this point in the history
relates-to: #69
  • Loading branch information
SplinterHead committed May 24, 2024
1 parent dbadc74 commit 058dca4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/boinc_client/boinc_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from .messages import get_all_notices, message_count, messages, public_notices
from .modes import set_cpu_run_mode, set_gpu_run_mode, set_network_mode
from .network import get_proxy_settings
from .preferences import (
get_global_prefs_file,
get_global_prefs_override,
Expand Down Expand Up @@ -177,3 +178,6 @@ def set_gpu_run_mode(self, run_mode: str, duration: int = 0) -> dict:

def set_network_mode(self, run_mode: str, duration: int = 0) -> dict:
return set_network_mode(self.rpc_client, run_mode, duration)

def get_proxy_settings(self) -> dict:
return get_proxy_settings(self.rpc_client)
1 change: 1 addition & 0 deletions src/boinc_client/messages.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging

import xmltodict

from boinc_client.clients.rpc_client import RpcClient
from boinc_client.models.message_count import MessageCount
from boinc_client.models.messages import Messages
Expand Down
2 changes: 1 addition & 1 deletion src/boinc_client/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from boinc_client.models.global_preferences import GlobalPreferences

logger = logging.getLogger(__name__)
logging.basicConfig(filename='boinc_client.log', encoding='utf-8', level=logging.DEBUG)
logging.basicConfig(filename="boinc_client.log", encoding="utf-8", level=logging.DEBUG)


def get_global_prefs_file(client: RpcClient) -> dict:
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_boinc_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def test_can_sequentially_set_global_overrides(boinc_test_client, project_weak_k


@mark.authenticated
def test_can_set_compute_modes(boinc_test_client, project_weak_key):
def test_can_set_compute_modes(boinc_test_client):
assert boinc_test_client.set_cpu_run_mode("always", 60) == {"success": True}
assert boinc_test_client.set_gpu_run_mode("auto", 0) == {"success": True}
assert boinc_test_client.set_network_mode("never") == {"success": True}

0 comments on commit 058dca4

Please sign in to comment.