Skip to content

Commit

Permalink
✨ Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
asim-shrestha committed Nov 1, 2023
1 parent fa27040 commit 8a52cbe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 60 deletions.
5 changes: 2 additions & 3 deletions platform/reworkd_platform/tests/agent/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,11 @@ def test_get_tools_overview_no_duplicates() -> None:


def test_get_default_tool() -> None:
assert get_default_tool() == Reason
assert get_default_tool() == Search


def test_get_tool_from_name() -> None:
assert get_tool_from_name("Search") == Search
assert get_tool_from_name("reason") == Reason
assert get_tool_from_name("CoNcLuDe") == Conclude
assert get_tool_from_name("NonExistingTool") == Reason
assert get_tool_from_name("NonExistingTool") == Search
assert get_tool_from_name("SID") == SID
57 changes: 0 additions & 57 deletions platform/reworkd_platform/tests/test_settings.py
Original file line number Diff line number Diff line change
@@ -1,62 +1,5 @@
from typing import Any, Dict

import pytest

from reworkd_platform.settings import Settings


@pytest.mark.parametrize(
"settings, expected",
[
(
{
"pusher_app_id": "123",
"pusher_key": "123",
"pusher_secret": "123",
"pusher_cluster": "123",
},
True,
),
(
{
"pusher_app_id": "123",
"pusher_cluster": "123",
},
False,
),
({}, False),
],
)
def test_pusher_enabled(settings: Dict[str, Any], expected: bool):
settings = Settings(**settings)
assert settings.pusher_enabled == expected


@pytest.mark.parametrize(
"settings, expected",
[
(
{
"kafka_bootstrap_servers": ["123"],
"kafka_username": "123",
"kafka_password": "123",
},
True,
),
(
{
"kafka_bootstrap_servers": ["123"],
"kafka_username": "123",
},
False,
),
({}, False),
],
)
def test_kafka_enabled(settings: Dict[str, Any], expected: bool):
settings = Settings(**settings)
assert settings.kafka_enabled == expected


def test_settings_create():
assert Settings() is not None

0 comments on commit 8a52cbe

Please sign in to comment.