(self)
| 8 | |
| 9 | class TestLoggerOutput(unittest.TestCase): |
| 10 | def setUp(self): |
| 11 | self.emissions_data = EmissionsData( |
| 12 | timestamp="2023-01-01T00:00:00", |
| 13 | project_name="test_project", |
| 14 | run_id="test_run_id", |
| 15 | experiment_id="test_experiment_id", |
| 16 | duration=10, |
| 17 | emissions=0.5, |
| 18 | emissions_rate=0.05, |
| 19 | cpu_power=20, |
| 20 | gpu_power=30, |
| 21 | ram_power=5, |
| 22 | cpu_energy=200, |
| 23 | gpu_energy=300, |
| 24 | ram_energy=50, |
| 25 | energy_consumed=550, |
| 26 | water_consumed=0.1, |
| 27 | country_name="Testland", |
| 28 | country_iso_code="TS", |
| 29 | region="Test Region", |
| 30 | cloud_provider="Test Cloud", |
| 31 | cloud_region="test-cloud-1", |
| 32 | os="TestOS", |
| 33 | python_version="3.8", |
| 34 | codecarbon_version="2.0", |
| 35 | cpu_count=4, |
| 36 | cpu_model="Test CPU", |
| 37 | gpu_count=1, |
| 38 | gpu_model="Test GPU", |
| 39 | longitude=0, |
| 40 | latitude=0, |
| 41 | ram_total_size=16, |
| 42 | tracking_mode="machine", |
| 43 | on_cloud="true", |
| 44 | pue=1.5, |
| 45 | wue=0.5, |
| 46 | ) |
| 47 | self.mock_logger = MagicMock() |
| 48 | |
| 49 | def test_logger_output_success(self): |
| 50 | logger_output = LoggerOutput(self.mock_logger, logging.WARNING) |
nothing calls this directly
no test coverage detected