11# License: MIT
22# Copyright © 2022 Frequenz Energy-as-a-Service GmbH
33
4- """Test for Config"""
4+ """Test for Config. """
55import pathlib
66import re
77
1616
1717
1818class Item (BaseModel ):
19- """Test item"""
19+ """Test item. """
2020
2121 item_id : int
2222 name : str
2323
2424
2525class TestConfig :
26- """Test for Config"""
26+ """Test for Config. """
2727
2828 conf_path = "sdk/config.toml"
2929 conf_content = """
@@ -61,7 +61,7 @@ def conf_vars(self, config_file: pathlib.Path) -> dict[str, Any]:
6161 return tomllib .load (file )
6262
6363 def test_get (self , conf_vars : dict [str , Any ]) -> None :
64- """Test get function"""
64+ """Test get function. """
6565 config = Config (conf_vars = conf_vars )
6666
6767 assert config .get ("logging_lvl" ) == "DEBUG"
@@ -70,7 +70,7 @@ def test_get(self, conf_vars: dict[str, Any]) -> None:
7070 assert config .get ("var2" , default = 0 ) == 0
7171
7272 def test_getitem (self , conf_vars : dict [str , Any ]) -> None :
73- """Test getitem function"""
73+ """Test getitem function. """
7474 config = Config (conf_vars = conf_vars )
7575
7676 assert config ["logging_lvl" ] == "DEBUG"
@@ -79,7 +79,7 @@ def test_getitem(self, conf_vars: dict[str, Any]) -> None:
7979 assert config ["var2" ]
8080
8181 def test_contains (self , conf_vars : dict [str , Any ]) -> None :
82- """Test contains function"""
82+ """Test contains function. """
8383 config = Config (conf_vars = conf_vars )
8484
8585 assert "logging_lvl" in config
@@ -116,7 +116,7 @@ def test_contains(self, conf_vars: dict[str, Any]) -> None:
116116 def test_get_as_success (
117117 self , key : str , expected_type : Any , value : Any , conf_vars : dict [str , Any ]
118118 ) -> None :
119- """Test get_as function with proper arguments"""
119+ """Test get_as function with proper arguments. """
120120
121121 config = Config (conf_vars = conf_vars )
122122 result = config .get_as (key , expected_type )
@@ -136,7 +136,7 @@ def test_get_as_success(
136136 def test_get_as_validation_error (
137137 self , key : str , expected_type : Any , conf_vars : dict [str , Any ]
138138 ) -> None :
139- """Test get_as function which raise ValidationError"""
139+ """Test get_as function which raise ValidationError. """
140140 config = Config (conf_vars = conf_vars )
141141
142142 err_msg = (
@@ -161,7 +161,7 @@ def test_get_dict_values_success(
161161 value : Any ,
162162 conf_vars : dict [str , Any ],
163163 ) -> None :
164- """Test get_as function with proper arguments"""
164+ """Test get_as function with proper arguments. """
165165
166166 config = Config (conf_vars = conf_vars )
167167 result = config .get_dict (key_prefix , expected_values_type )
@@ -178,7 +178,7 @@ def test_get_dict_values_success(
178178 def test_get_dict_success (
179179 self , key_prefix : str , expected_values_type : Any , conf_vars : dict [str , Any ]
180180 ) -> None :
181- """Test get_as function with proper arguments"""
181+ """Test get_as function with proper arguments. """
182182
183183 config = Config (conf_vars = conf_vars )
184184
0 commit comments