MCPcopy Create free account
hub / github.com/theskumar/python-dotenv / prepare_file_hierarchy

Function prepare_file_hierarchy

tests/test_main.py:202–223  ·  view source on GitHub ↗

Create a temporary folder structure like the following: test_find_dotenv0/ └── child1 ├── child2 │ └── child3 │ └── child4 └── .env Then try to automatically `find_dotenv` starting in `child4`

(path)

Source from the content-addressed store, hash-verified

200
201
202def prepare_file_hierarchy(path):
203 """
204 Create a temporary folder structure like the following:
205
206 test_find_dotenv0/
207 └── child1
208 ├── child2
209 │   └── child3
210 │   └── child4
211 └── .env
212
213 Then try to automatically `find_dotenv` starting in `child4`
214 """
215
216 curr_dir = path
217 dirs = []
218 for f in ['child1', 'child2', 'child3', 'child4']:
219 curr_dir /= f
220 dirs.append(curr_dir)
221 curr_dir.mkdir()
222
223 return (dirs[0], dirs[-1])
224
225
226def test_find_dotenv_no_file_raise(tmp_path):

Callers 3

test_find_dotenv_foundFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected