| Total Complexity | 6 |
| Total Lines | 19 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | import os |
||
| 17 | class TestDotEnv(unittest.TestCase): |
||
| 18 | |||
| 19 | @classmethod |
||
| 20 | def setUpClass(cls): |
||
| 21 | with NamedTemporaryFile(suffix='.env', delete=False) as tmp: |
||
| 22 | with open(tmp.name, 'w', encoding='UTF-8') as file: |
||
| 23 | file.write(mock_dotenv()) |
||
| 24 | cls.path = tmp.name |
||
| 25 | |||
| 26 | def test_read_dotenv(self): |
||
| 27 | expected = [('SECRET', 'quiet'), ('DB', 'drawer')] |
||
| 28 | result = list(read_dotenv(self.path)) |
||
| 29 | |||
| 30 | self.assertEqual(expected, result) |
||
| 31 | |||
| 32 | @classmethod |
||
| 33 | def tearDown(cls): |
||
| 34 | if os.path.exists(cls.path): |
||
| 35 | os.unlink(cls.path) |
||
| 36 |
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.