@@ -79,15 +79,15 @@ def test_raises_with_no_file(self):
79
79
with pytest .raises (
80
80
FileNotFoundError , match = "settings.toml not cound in current directory."
81
81
):
82
- load_settings_toml (return_toml = True )
82
+ load_settings_toml ()
83
83
84
84
@mock .patch ("adafruit_blinka.os.path.isfile" , mock .Mock (return_value = True ))
85
85
@mock .patch ("builtins.open" , mock .mock_open (read_data = INVALID_TOML ))
86
86
def test_raises_with_invalid_file (self ):
87
87
with pytest .raises (
88
88
tomllib .TOMLDecodeError , match = "Error with settings.toml file."
89
89
):
90
- load_settings_toml (return_toml = True )
90
+ load_settings_toml ()
91
91
92
92
@mock .patch ("adafruit_blinka.os.path.isfile" , mock .Mock (return_value = True ))
93
93
@mock .patch (
@@ -97,7 +97,7 @@ def test_raises_with_invalid_file_dict(self):
97
97
with pytest .raises (
98
98
ValueError , match = "The types: 'dict' are not supported in settings.toml."
99
99
):
100
- load_settings_toml (return_toml = True )
100
+ load_settings_toml ()
101
101
102
102
@mock .patch ("adafruit_blinka.os.path.isfile" , mock .Mock (return_value = True ))
103
103
@mock .patch (
@@ -107,7 +107,7 @@ def test_raises_with_invalid_file_list(self):
107
107
with pytest .raises (
108
108
ValueError , match = "The types: 'list' are not supported in settings.toml."
109
109
):
110
- load_settings_toml (return_toml = True )
110
+ load_settings_toml ()
111
111
112
112
@mock .patch ("adafruit_blinka.os.path.isfile" , mock .Mock (return_value = True ))
113
113
@mock .patch (
@@ -118,7 +118,7 @@ def test_raises_with_invalid_file_many(self):
118
118
ValueError ,
119
119
match = "The types: 'dict, list' are not supported in settings.toml." ,
120
120
):
121
- load_settings_toml (return_toml = True )
121
+ load_settings_toml ()
122
122
123
123
@mock .patch ("adafruit_blinka.os.path.isfile" , mock .Mock (return_value = True ))
124
124
@mock .patch (
@@ -129,7 +129,7 @@ def test_raises_with_invalid_file_nested(self):
129
129
with pytest .raises (
130
130
ValueError , match = "The types: 'dict' are not supported in settings.toml."
131
131
):
132
- load_settings_toml (return_toml = True )
132
+ load_settings_toml ()
133
133
134
134
@mock .patch ("adafruit_blinka.os.path.isfile" , mock .Mock (return_value = True ))
135
135
@mock .patch ("builtins.open" , mock .mock_open (read_data = VALID_TOML ))
@@ -138,19 +138,7 @@ def test_returns_data(self):
138
138
for key in CONVERTED_TOML :
139
139
assert os .getenv (key ) is None
140
140
141
- assert load_settings_toml () is None
142
-
143
- for key , value in CONVERTED_TOML .items ():
144
- assert os .getenv (key ) == str (value )
145
-
146
- @mock .patch ("adafruit_blinka.os.path.isfile" , mock .Mock (return_value = True ))
147
- @mock .patch ("builtins.open" , mock .mock_open (read_data = VALID_TOML ))
148
- @mock .patch .dict (os .environ , {}, clear = True )
149
- def test_returns_data_when_asked (self ):
150
- for key in CONVERTED_TOML :
151
- assert os .getenv (key ) is None
152
-
153
- assert load_settings_toml (return_toml = True ) == CONVERTED_TOML
141
+ assert load_settings_toml () == CONVERTED_TOML
154
142
155
143
for key , value in CONVERTED_TOML .items ():
156
144
assert os .getenv (key ) == str (value )
0 commit comments