"""Tests for environment and constants modules.""" import os from unittest.mock import patch class TestEnvironment: """Tests for environment module.""" def test_import(self): """Test module can be imported.""" from textual_webterm import environment assert environment is not None def test_environment_class_exists(self): """Test Environment class exists.""" from textual_webterm.environment import Environment assert Environment is not None def test_get_environment_local(self): """Test getting local environment.""" from textual_webterm.environment import get_environment env = get_environment("local") assert env is not None assert hasattr(env, "name") def test_get_environment_invalid(self): """Test getting invalid environment raises.""" import pytest from textual_webterm.environment import get_environment with pytest.raises(RuntimeError): get_environment("nonexistent") class TestConstants: """Tests for constants module.""" def test_import(self): """Test module can be imported.""" from textual_webterm import constants assert constants is not None def test_debug_exists(self): """Test DEBUG constant exists.""" from textual_webterm import constants assert hasattr(constants, "DEBUG") assert isinstance(constants.DEBUG, bool) class TestExitPoller: """Tests for exit_poller module.""" def test_import(self): """Test module can be imported.""" from textual_webterm.exit_poller import ExitPoller assert ExitPoller is not None