def test_summary_url(): client = OuraClient("test_id") url = client._build_summary_url(start="start-date", end=None, summary_type="sleep") parsed_url = urlparse(url) params = parse_qs(parsed_url.query) assert "end" not in params.keys() url2 = client._build_summary_url(start="start-date", end="end_date", summary_type="sleep") parsed_url = urlparse(url2) params = parse_qs(parsed_url.query) assert "end" in params.keys()
def test_summary_url(): client = OuraClient('test_id') url = client._build_summary_url(start='start-date', end=None, datatype='sleep') parsed_url = urlparse(url) params = parse_qs(parsed_url.query) assert 'end' not in params.keys() url2 = client._build_summary_url(start='start-date', end='end_date', datatype='sleep') parsed_url = urlparse(url2) params = parse_qs(parsed_url.query) assert 'end' in params.keys()