(self)
| 17 | |
| 18 | class TestMiscellaneous(unittest.TestCase): |
| 19 | def test_load(self): |
| 20 | content = "one=1 \n two='two' \n arr=[]" |
| 21 | expected = {"one": 1, "two": "two", "arr": []} |
| 22 | with tempfile.TemporaryDirectory() as tmp_dir_path: |
| 23 | file_path = Path(tmp_dir_path) / "test.toml" |
| 24 | file_path.write_text(content) |
| 25 | |
| 26 | with open(file_path, "rb") as bin_f: |
| 27 | actual = tomllib.load(bin_f) |
| 28 | self.assertEqual(actual, expected) |
| 29 | |
| 30 | def test_incorrect_load(self): |
| 31 | content = "one=1" |
nothing calls this directly
no test coverage detected