Skip to content

Commit

Permalink
add simple test for launch_start_daemon
Browse files Browse the repository at this point in the history
  • Loading branch information
emlowe committed Jul 31, 2024
1 parent 4389cad commit 8755712
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion chia/_tests/cmds/test_daemon.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import sys
from pathlib import Path
from typing import Any, Dict, Optional

Expand All @@ -9,7 +10,7 @@
from pytest_mock import MockerFixture

from chia.cmds.chia import cli
from chia.cmds.start_funcs import create_start_daemon_connection
from chia.cmds.start_funcs import create_start_daemon_connection, launch_start_daemon


@pytest.mark.anyio
Expand Down Expand Up @@ -52,6 +53,15 @@ def get_current_passphrase() -> Optional[str]:
assert not captured.out.endswith("Skipping to unlock keyring\n")


@pytest.mark.anyio
def test_launch_start_daemon(tmp_path: Path) -> None:
sys.argv[0] = "chia"
process = launch_start_daemon(tmp_path)
assert process is not None
process.kill()
process.wait()


def test_start_daemon(tmp_path: Path, empty_keyring: Any, mocker: MockerFixture) -> None:
class DummyDaemon:
@staticmethod
Expand Down

0 comments on commit 8755712

Please sign in to comment.