def test_get_metrics_completed(self, sample_build): sample_build["status"] = "success" mock_api = MagicMock() build = Build(sample_build, mock_api) metrics = build.get_metrics() assert isinstance(metrics, BuildMetrics)
def test_get_metrics_not_completed(self, sample_build): sample_build["status"] = "created" build = Build(sample_build, None) assert not build.get_metrics()
def test_get_metrics_not_completed(self, sample_build): sample_build['status'] = 'created' build = Build(sample_build, None) assert not build.get_metrics()