Beispiel #1
0
    def _handle_endpoints(self, endpoints: List[Dict]) -> List[Dict]:
        """
        Endpoints 配置填充数据

        :param endpoints: 原始数据
        :return: 完成补充的数据
        """
        for endpoint in endpoints:
            endpoint.setdefault('path', constants.DEFAULT_ENDPOINT_PATH)
            endpoint['interval'] = get_duration_seconds(
                endpoint.get('interval'), constants.DEFAULT_ENDPOINT_INTERVAL)
        return endpoints
Beispiel #2
0
def test_get_duration_seconds(duration, default, expired):
    assert get_duration_seconds(duration, default) == expired