Coverage for tests\test_readin_env.py: 100%

13 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-12-01 10:33 -0500

1import os 

2import tempfile 

3 

4import receptiviti 

5 

6 

7class TestEnv: 

8 def test_explicit_works(self): 

9 receptiviti.readin_env() 

10 assert os.getenv("RECEPTIVITI_TEST") is None 

11 with tempfile.NamedTemporaryFile("w", delete=False) as file: 

12 file.write("RECEPTIVITI_TEST='123'\n") 

13 path = file.name 

14 receptiviti.readin_env(path) 

15 os.unlink(path) 

16 assert os.getenv("RECEPTIVITI_TEST") == "123"