11"""Tests for configuration management."""
22
3- import os
43from pathlib import Path
54
65import pytest
@@ -56,7 +55,7 @@ def test_get_site_config(self, test_config_path):
5655 """Test retrieving site configuration."""
5756 config = Config (test_config_path )
5857 site_config = config .get_site_config ("production" )
59-
58+
6059 assert site_config is not None
6160 assert site_config ["url" ] == "https://erp.example.com"
6261 assert site_config ["api_key" ] == "prod_key_123"
@@ -72,15 +71,15 @@ def test_get_default_site_config(self, test_config_path):
7271 """Test retrieving default site configuration."""
7372 config = Config (test_config_path )
7473 site_config = config .get_default_site_config ()
75-
74+
7675 assert site_config is not None
7776 assert site_config ["url" ] == "https://erp.example.com"
7877
7978 def test_list_sites (self , test_config_path ):
8079 """Test listing all configured sites."""
8180 config = Config (test_config_path )
8281 sites = config .list_sites ()
83-
82+
8483 assert len (sites ) == 3
8584 assert "production" in sites
8685 assert "staging" in sites
@@ -94,18 +93,18 @@ def test_env_var_substitution(self, test_config_path, monkeypatch):
9493 """Test environment variable substitution."""
9594 monkeypatch .setenv ("FRAPPE_STAGING_KEY" , "staging_key_from_env" )
9695 monkeypatch .setenv ("FRAPPE_STAGING_SECRET" , "staging_secret_from_env" )
97-
96+
9897 config = Config (test_config_path )
9998 site_config = config .get_site_config ("staging" )
100-
99+
101100 assert site_config ["api_key" ] == "staging_key_from_env"
102101 assert site_config ["api_secret" ] == "staging_secret_from_env"
103102
104103 def test_env_var_missing (self , test_config_path , monkeypatch ):
105104 """Test missing environment variable."""
106105 monkeypatch .delenv ("FRAPPE_STAGING_KEY" , raising = False )
107106 monkeypatch .delenv ("FRAPPE_STAGING_SECRET" , raising = False )
108-
107+
109108 config = Config (test_config_path )
110109 with pytest .raises (ConfigError , match = "Environment variable.*not set" ):
111110 config .get_site_config ("staging" )
0 commit comments