Test creating from dict with all fields.
(self)
| 55 | assert config.source == "Test" |
| 56 | |
| 57 | def test_from_dict_full(self): |
| 58 | """Test creating from dict with all fields.""" |
| 59 | data = { |
| 60 | "file_path": "/data/test.json", |
| 61 | "source": "TestSource", |
| 62 | "data_size": 500, |
| 63 | "custom_field": "data", # Extra fields go into 'extra' dict |
| 64 | } |
| 65 | config = DatasetConfig.from_dict(data) |
| 66 | assert config.file_path == "/data/test.json" |
| 67 | assert config.source == "TestSource" |
| 68 | assert config.data_size == 500 |
| 69 | assert config.extra == {"custom_field": "data"} |
| 70 | |
| 71 | def test_to_dict(self): |
| 72 | """Test converting to dict.""" |