def test_create(self, comparison, threshold, reference_sample_id): alerter = ReferenceAlerter(comparison(threshold), reference_sample_id) msg = _AlertService.AlertReference( threshold=threshold, reference_sample_id=reference_sample_id, operator=comparison._OPERATOR, ) assert alerter._as_proto() == msg
def test_from_proto(self, comparison, threshold, reference_sample_id): msg = _AlertService.AlertReference( threshold=threshold, reference_sample_id=reference_sample_id, operator=comparison._OPERATOR, ) alerter = _Alerter._from_proto(msg) assert type(alerter) is ReferenceAlerter assert alerter._as_proto() == msg
def _as_proto(self): return _AlertService.AlertReference( threshold=self._comparison.value, reference_sample_id=self._reference_sample_id, operator=self._comparison._operator_as_proto(), )