def test_get_refcat_id_throws_correct_exception_when_key_missing(logger, without_key): with pytest.raises(NoAutoguider) as err: get_refcat_id(without_key) assert 'not autoguided' in str(err).lower() assert logger.exception.call_args_list == [ mock.call(mock.ANY, without_key), ]
def test_get_refcat_id(with_key, ref_id): ref_image_id = get_refcat_id(with_key) assert ref_image_id == ref_id