Test saving empty list.
(self, json_format, temp_dir)
| 156 | assert "unicode test value" in content |
| 157 | |
| 158 | def test_save_empty_list(self, json_format, temp_dir): |
| 159 | """Test saving empty list.""" |
| 160 | filepath = os.path.join(temp_dir, "empty.json") |
| 161 | json_format.save([], filepath) |
| 162 | |
| 163 | with open(filepath, "r") as f: |
| 164 | loaded = json.load(f) |
| 165 | assert loaded == [] |
| 166 | |
| 167 | def test_save_creates_parent_directory( |
| 168 | self, json_format, temp_dir, sample_data_list |