diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index ff9390d..a99dd3c 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -13,18 +13,19 @@ jobs: name: Build package documentation runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v5 with: python-version: 3.11 - - name: Install dependencies + enable-cache: true + - name: Install hatch run: | - python -m pip install --upgrade pip - python -m pip install -r requirements.txt - python -m pip install pdoc + uv pip install hatch - name: Build docs - run: pdoc -o docs pydexcom - - uses: actions/upload-pages-artifact@v2 + run: hatch run docs:build + - uses: actions/upload-pages-artifact@v3 with: path: docs pages: @@ -39,4 +40,4 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} steps: - id: deployment - uses: actions/deploy-pages@v2 \ No newline at end of file + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index dc03347..de9c801 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -9,6 +9,9 @@ jobs: name: Run pre-commit runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 - - uses: pre-commit/action@v3.0.0 + - name: Checkout repository + uses: actions/checkout@v4 + - name: Run pre-commit + uses: pre-commit/action@v3.0.1 + with: + extra_args: "--all-files" diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 2232a27..1fa8924 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -15,12 +15,17 @@ jobs: permissions: id-token: write steps: - - uses: actions/checkout@v3 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install build setuptools setuptools_scm + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: + python-version: 3.11 + enable-cache: true + - name: Install hatch + run: + uv pip install hatch - name: Build package distributions - run: python3 -m build + run: hatch build - name: Publish package distributions to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file + uses: pypa/gh-action-pypi-publish@v1.12.4 \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index aa49eb6..0e6d089 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -3,6 +3,8 @@ name: test on: pull_request: push: + branches: + - main jobs: test: @@ -13,14 +15,15 @@ jobs: matrix: python-version: ["3.9", "3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v5 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -r requirements.txt - python -m pip install -r tests/requirements.txt + enable-cache: true + - name: Install hatch + run: + uv pip install hatch - name: Run tests - run: python -m pytest --record-mode=none + run: hatch test --python ${{ matrix.python-version }} --parallel diff --git a/.gitignore b/.gitignore index 1932143..e911225 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ build/ .pytest_cache/ .DS_Store .ruff_cache +uv.lock +docs/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b8c78a1..0fabfa0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,18 +1,19 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: trailing-whitespace - id: check-yaml - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.11.2 + rev: v1.16.0 hooks: - id: mypy additional_dependencies: [types-requests] + exclude: ^tests/ # pre-commit does not support mypy_path for stubs - - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.6.7 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.11.13 hooks: - - id: ruff + - id: ruff-check - id: ruff-format diff --git a/.vscode/settings.json b/.vscode/settings.json index 960554a..50a32c5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,19 +1,25 @@ { - "mypy.dmypyExecutable": "${workspaceFolder}/.venv/bin/dmypy", - "python.testing.pytestArgs": [ - "tests", - "--record-mode=none" - ], - "python.testing.pytestEnabled": true, - "editor.formatOnSave": true, - "mypy.configFile": "pyproject.toml", - "[python]": { - "editor.codeActionsOnSave": { - "source.organizeImports": "explicit" - }, - "editor.defaultFormatter": "charliermarsh.ruff" + "mypy.dmypyExecutable": "${workspaceFolder}/.venv/bin/dmypy", + "python.testing.pytestArgs": ["tests", "--record-mode=none"], + "python.testing.pytestEnabled": true, + "editor.formatOnSave": true, + "mypy.configFile": "pyproject.toml", + "[python]": { + "editor.codeActionsOnSave": { + "source.organizeImports": "explicit" }, - "cSpell.words": [ - "pydexcom" - ], -} \ No newline at end of file + "editor.defaultFormatter": "charliermarsh.ruff" + }, + "cSpell.words": [ + "addinivalue", + "addoption", + "autouse", + "fixturename", + "getgroup", + "mmol", + "mypy", + "pdoc", + "pydexcom", + "vcrpy" + ] +} diff --git a/pydexcom/__init__.py b/pydexcom/__init__.py index d9004ba..6dcfe79 100644 --- a/pydexcom/__init__.py +++ b/pydexcom/__init__.py @@ -1,377 +1,15 @@ """ .. include:: ../README.md -""" # noqa: D200, D212, D400, D415 - -from __future__ import annotations - -import logging -import re -from datetime import datetime -from typing import Any -from uuid import UUID - -import requests - -from .const import ( - DEFAULT_UUID, - DEXCOM_APPLICATION_IDS, - DEXCOM_AUTHENTICATE_ENDPOINT, - DEXCOM_BASE_URLS, - DEXCOM_GLUCOSE_READINGS_ENDPOINT, - DEXCOM_LOGIN_ID_ENDPOINT, - DEXCOM_TREND_DIRECTIONS, - MAX_MAX_COUNT, - MAX_MINUTES, - MMOL_L_CONVERSION_FACTOR, - TREND_ARROWS, - TREND_DESCRIPTIONS, - Region, -) -from .errors import ( - AccountError, - AccountErrorEnum, - ArgumentError, - ArgumentErrorEnum, - DexcomError, - SessionError, - SessionErrorEnum, -) - -_LOGGER = logging.getLogger("pydexcom") - - -class GlucoseReading: - """Class for parsing glucose reading from Dexcom Share API.""" - - def __init__(self, json_glucose_reading: dict[str, Any]) -> None: - """Initialize `GlucoseReading` with JSON glucose reading from Dexcom Share API. - - :param json_glucose_reading: JSON glucose reading from Dexcom Share API - """ - self._json = json_glucose_reading - try: - self._value = int(json_glucose_reading["Value"]) - self._trend_direction: str = json_glucose_reading["Trend"] - # Dexcom Share API returns `str` direction now, previously `int` trend - self._trend: int = DEXCOM_TREND_DIRECTIONS[self._trend_direction] - - match = re.match( - r"Date\((?P\d+)(?P[+-]\d{4})\)", - json_glucose_reading["DT"], - ) - if match: - self._datetime = datetime.fromtimestamp( - int(match.group("timestamp")) / 1000.0, - tz=datetime.strptime(match.group("timezone"), "%z").tzinfo, - ) - except (KeyError, TypeError, ValueError) as error: - raise ArgumentError(ArgumentErrorEnum.GLUCOSE_READING_INVALID) from error - - @property - def value(self) -> int: - """Blood glucose value in mg/dL.""" - return self._value - - @property - def mg_dl(self) -> int: - """Blood glucose value in mg/dL.""" - return self._value - - @property - def mmol_l(self) -> float: - """Blood glucose value in mmol/L.""" - return round(self.value * MMOL_L_CONVERSION_FACTOR, 1) - - @property - def trend(self) -> int: - """Blood glucose trend information. - - Value of `pydexcom.const.DEXCOM_TREND_DIRECTIONS`. - """ - return self._trend - - @property - def trend_direction(self) -> str: - """Blood glucose trend direction. - - Key of `pydexcom.const.DEXCOM_TREND_DIRECTIONS`. - """ - return self._trend_direction - - @property - def trend_description(self) -> str | None: - """Blood glucose trend information description. - - See `pydexcom.const.TREND_DESCRIPTIONS`. - """ - return TREND_DESCRIPTIONS[self._trend] - - @property - def trend_arrow(self) -> str: - """Blood glucose trend as unicode arrow (`pydexcom.const.TREND_ARROWS`).""" - return TREND_ARROWS[self._trend] - - @property - def datetime(self) -> datetime: - """Glucose reading recorded time as datetime.""" - return self._datetime - - @property - def json(self) -> dict[str, Any]: - """JSON glucose reading from Dexcom Share API.""" - return self._json - - def __str__(self) -> str: - """Blood glucose value as in mg/dL.""" - return str(self._value) - - -def valid_uuid(uuid: str | None) -> bool: - """Check if UUID is valid.""" - try: - UUID(str(uuid)) - except ValueError: - return False - else: - return True - - -class Dexcom: - """Class for communicating with Dexcom Share API.""" - - def __init__( - self, - *, - password: str, - account_id: str | None = None, - username: str | None = None, - region: Region = Region.US, - ) -> None: - """Initialize `Dexcom` with Dexcom Share credentials. - - :param username: username for the Dexcom Share user, *not follower*. - :param account_id: account ID for the Dexcom Share user, *not follower*. - :param password: password for the Dexcom Share user. - :param region: the region to use, one of `"us"`, `"ous"`, `"jp"`. - """ - user_ids = sum(user_id is not None for user_id in [account_id, username]) - if user_ids == 0: - raise ArgumentError(ArgumentErrorEnum.NONE_USER_ID_PROVIDED) - if user_ids != 1: - raise ArgumentError(ArgumentErrorEnum.TOO_MANY_USER_ID_PROVIDED) - - self._base_url = DEXCOM_BASE_URLS[region] - self._application_id = DEXCOM_APPLICATION_IDS[region] - self._password = password - self._username: str | None = username - self._account_id: str | None = account_id - self._session_id: str | None = None - self.__session = requests.Session() - self._session() - - def _post( - self, - endpoint: str, - params: dict[str, Any] | None = None, - json: dict[str, Any] | None = None, - ) -> Any: # noqa: ANN401 - """Send post request to Dexcom Share API. - - :param endpoint: URL of the post request - :param params: `dict` to send in the query string of the post request - :param json: JSON to send in the body of the post request - """ - response = self.__session.post( - f"{self._base_url}/{endpoint}", - headers={"Accept-Encoding": "application/json"}, - params=params, - json={} if json is None else json, - ) - - try: - response.raise_for_status() - return response.json() - except requests.HTTPError as http_error: - error = self._handle_response(response) - if error: - raise error from http_error - _LOGGER.exception("%s", response.text) - raise - - def _handle_response(self, response: requests.Response) -> DexcomError | None: # noqa: C901 - error: DexcomError | None = None - """ - Parse `requests.Response` for `pydexcom.errors.DexcomError`. - - :param response: `requests.Response` to parse - """ - if response.json(): - _LOGGER.debug("%s", response.json()) - code = response.json().get("Code", None) - message = response.json().get("Message", None) - if code == "SessionIdNotFound": - error = SessionError(SessionErrorEnum.NOT_FOUND) - elif code == "SessionNotValid": - error = SessionError(SessionErrorEnum.INVALID) - elif code == "AccountPasswordInvalid": # defunct - error = AccountError(AccountErrorEnum.FAILED_AUTHENTICATION) - elif code == "SSO_AuthenticateMaxAttemptsExceeded": - error = AccountError(AccountErrorEnum.MAX_ATTEMPTS) - elif code == "SSO_InternalError": - if message and ( - "Cannot Authenticate by AccountName" in message - or "Cannot Authenticate by AccountId" in message - ): - error = AccountError(AccountErrorEnum.FAILED_AUTHENTICATION) - elif code == "InvalidArgument": - if message and "accountName" in message: - error = ArgumentError(ArgumentErrorEnum.USERNAME_INVALID) - elif message and "password" in message: - error = ArgumentError(ArgumentErrorEnum.PASSWORD_INVALID) - elif message and "UUID" in message: - error = ArgumentError(ArgumentErrorEnum.ACCOUNT_ID_INVALID) - elif code and message: - _LOGGER.debug("%s: %s", code, message) - return error - - def _validate_session_id(self) -> None: - """Validate session ID.""" - if any( - [ - not isinstance(self._session_id, str), - not self._session_id, - not valid_uuid(self._session_id), - ], - ): - raise ArgumentError(ArgumentErrorEnum.SESSION_ID_INVALID) - if self._session_id == DEFAULT_UUID: - raise ArgumentError(ArgumentErrorEnum.SESSION_ID_DEFAULT) - - def _validate_username(self) -> None: - """Validate username.""" - if any([not isinstance(self._username, str), not self._username]): - raise ArgumentError(ArgumentErrorEnum.USERNAME_INVALID) - - def _validate_password(self) -> None: - """Validate password.""" - if any([not isinstance(self._password, str), not self._password]): - raise ArgumentError(ArgumentErrorEnum.PASSWORD_INVALID) - - def _validate_account_id(self) -> None: - """Validate account ID.""" - if any( - [ - not isinstance(self._account_id, str), - not self._account_id, - not valid_uuid(self._account_id), - ], - ): - raise ArgumentError(ArgumentErrorEnum.ACCOUNT_ID_INVALID) - if self._account_id == DEFAULT_UUID: - raise ArgumentError(ArgumentErrorEnum.ACCOUNT_ID_DEFAULT) - - def _get_account_id(self) -> str: - """Retrieve account ID from the authentication endpoint. - - See `pydexcom.const.DEXCOM_AUTHENTICATE_ENDPOINT`. - """ - _LOGGER.debug("Retrieve account ID from the authentication endpoint") - return self._post( - DEXCOM_AUTHENTICATE_ENDPOINT, - json={ - "accountName": self._username, - "password": self._password, - "applicationId": self._application_id, - }, - ) - - def _get_session_id(self) -> str: - """Retrieve session ID from the login endpoint. - - See `pydexcom.const.DEXCOM_LOGIN_ID_ENDPOINT`. - """ - _LOGGER.debug("Retrieve session ID from the login endpoint") - return self._post( - DEXCOM_LOGIN_ID_ENDPOINT, - json={ - "accountId": self._account_id, - "password": self._password, - "applicationId": self._application_id, - }, - ) - - def _session(self) -> None: - """Create Dexcom Share API session.""" - self._validate_password() - - if self._account_id is None: - self._validate_username() - self._account_id = self._get_account_id() - - self._validate_account_id() - self._session_id = self._get_session_id() - self._validate_session_id() - - def _get_glucose_readings( - self, - minutes: int = MAX_MINUTES, - max_count: int = MAX_MAX_COUNT, - ) -> list[dict[str, Any]]: - """Retrieve glucose readings from the glucose readings endpoint. - - See `pydexcom.const.DEXCOM_GLUCOSE_READINGS_ENDPOINT`. - """ - if not isinstance(minutes, int) or any([minutes < 0, minutes > MAX_MINUTES]): - raise ArgumentError(ArgumentErrorEnum.MINUTES_INVALID) - if not isinstance(max_count, int) or any( - [max_count < 0, max_count > MAX_MAX_COUNT], - ): - raise ArgumentError(ArgumentErrorEnum.MAX_COUNT_INVALID) - - _LOGGER.debug("Retrieve glucose readings from the glucose readings endpoint") - return self._post( - DEXCOM_GLUCOSE_READINGS_ENDPOINT, - params={ - "sessionId": self._session_id, - "minutes": minutes, - "maxCount": max_count, - }, - ) - - def get_glucose_readings( - self, - minutes: int = MAX_MINUTES, - max_count: int = MAX_MAX_COUNT, - ) -> list[GlucoseReading]: - """Get `max_count` glucose readings within specified number of `minutes`. - - Catches one instance of a thrown `pydexcom.errors.SessionError` if session ID - expired, attempts to get a new session ID and retries. - - :param minutes: Number of minutes to retrieve glucose readings from (1-1440) - :param max_count: Maximum number of glucose readings to retrieve (1-288) - """ - json_glucose_readings: list[dict[str, Any]] = [] - - try: - # Requesting glucose reading with DEFAULT_UUID returns non-JSON empty string - self._validate_session_id() - - json_glucose_readings = self._get_glucose_readings(minutes, max_count) - except SessionError: - # Attempt to update expired session ID - self._session() - - json_glucose_readings = self._get_glucose_readings(minutes, max_count) - - return [GlucoseReading(json_reading) for json_reading in json_glucose_readings] - - def get_latest_glucose_reading(self) -> GlucoseReading | None: - """Get latest available glucose reading, within the last 24 hours.""" - glucose_readings = self.get_glucose_readings(max_count=1) - return glucose_readings[0] if glucose_readings else None - - def get_current_glucose_reading(self) -> GlucoseReading | None: - """Get current available glucose reading, within the last 10 minutes.""" - glucose_readings = self.get_glucose_readings(minutes=10, max_count=1) - return glucose_readings[0] if glucose_readings else None +""" # noqa: D200, D400, D415 + +from .const import Region +from .dexcom import Dexcom +from .glucose_reading import GlucoseReading + +__all__ = [ + "Dexcom", + "GlucoseReading", + "Region", + "const", + "errors", +] diff --git a/pydexcom/const.py b/pydexcom/const.py index 38d6607..8b016cd 100644 --- a/pydexcom/const.py +++ b/pydexcom/const.py @@ -27,13 +27,13 @@ class Region(str, Enum): } """Dexcom application ID lookup based on `Region`.""" -DEXCOM_BASE_URL: str = "https://share2.dexcom.com/ShareWebServices/Services" +DEXCOM_BASE_URL: str = "https://share2.dexcom.com/ShareWebServices/Services/" """Dexcom Share API base url for US.""" -DEXCOM_BASE_URL_OUS: str = "https://shareous1.dexcom.com/ShareWebServices/Services" +DEXCOM_BASE_URL_OUS: str = "https://shareous1.dexcom.com/ShareWebServices/Services/" """Dexcom Share API base url for outside of the US.""" -DEXCOM_BASE_URL_JP: str = "https://share.dexcom.jp/ShareWebServices/Services" +DEXCOM_BASE_URL_JP: str = "https://share.dexcom.jp/ShareWebServices/Services/" """Dexcom Share API base url for Japan.""" DEXCOM_BASE_URLS: dict[Region, str] = { @@ -52,6 +52,9 @@ class Region(str, Enum): DEXCOM_GLUCOSE_READINGS_ENDPOINT: str = "Publisher/ReadPublisherLatestGlucoseValues" """Dexcom Share API endpoint used to retrieve glucose values.""" +HEADERS = {"Accept-Encoding": "application/json"} +"""Dexcom headers for all endpoints.""" + DEFAULT_UUID: str = "00000000-0000-0000-0000-000000000000" """UUID consisting of all zeros, likely error if returned by Dexcom Share API.""" diff --git a/pydexcom/dexcom.py b/pydexcom/dexcom.py new file mode 100644 index 0000000..2bb9b72 --- /dev/null +++ b/pydexcom/dexcom.py @@ -0,0 +1,302 @@ +"""Dexcom class implementation.""" + +from __future__ import annotations + +from typing import Any + +import requests + +from .const import ( + DEFAULT_UUID, + DEXCOM_APPLICATION_IDS, + DEXCOM_AUTHENTICATE_ENDPOINT, + DEXCOM_BASE_URLS, + DEXCOM_GLUCOSE_READINGS_ENDPOINT, + DEXCOM_LOGIN_ID_ENDPOINT, + HEADERS, + MAX_MAX_COUNT, + MAX_MINUTES, + Region, +) +from .errors import ( + AccountError, + AccountErrorEnum, + ArgumentError, + ArgumentErrorEnum, + DexcomError, + SessionError, + SessionErrorEnum, +) +from .glucose_reading import GlucoseReading +from .util import _LOGGER, valid_uuid + + +class Dexcom: + """Class for communicating with Dexcom Share API.""" + + def __init__( + self, + *, + password: str, + account_id: str | None = None, + username: str | None = None, + region: Region = Region.US, + ) -> None: + """ + Initialize `Dexcom` with Dexcom Share credentials. + + :param username: username for the Dexcom Share user, *not follower*. + :param account_id: account ID for the Dexcom Share user, *not follower*. + :param password: password for the Dexcom Share user. + :param region: the region to use, one of `"us"`, `"ous"`, `"jp"`. + """ + self._validate_region(region) + self._validate_user_ids(account_id, username) + + self._base_url = DEXCOM_BASE_URLS[region] + self._application_id = DEXCOM_APPLICATION_IDS[region] + self._password = password + self._username: str | None = username + self._account_id: str | None = account_id + self._session_id: str | None = None + self._session = requests.Session() + self._get_session() + + def _post( + self, + endpoint: str, + params: dict[str, Any] | None = None, + json: dict[str, Any] | None = None, + ) -> Any: # noqa: ANN401 + """ + Send post request to Dexcom Share API. + + :param endpoint: URL of the post request + :param params: `dict` to send in the query string of the post request + :param json: JSON to send in the body of the post request + """ + response = self._session.post( + f"{self._base_url}{endpoint}", + headers=HEADERS, + params=params, + json={} if json is None else json, + ) + + try: + response.raise_for_status() + return response.json() + except requests.HTTPError as http_error: + error = self._handle_response(response) + if error: + raise error from http_error + _LOGGER.exception("%s", response.text) + raise + + def _handle_response(self, response: requests.Response) -> DexcomError | None: # noqa: C901 + error: DexcomError | None = None + """ + Parse `requests.Response` for `pydexcom.errors.DexcomError`. + + :param response: `requests.Response` to parse + """ + if response.json(): + _LOGGER.debug("%s", response.json()) + code = response.json().get("Code", None) + message = response.json().get("Message", None) + if code == "SessionIdNotFound": + error = SessionError(SessionErrorEnum.NOT_FOUND) + elif code == "SessionNotValid": + error = SessionError(SessionErrorEnum.INVALID) + elif code == "AccountPasswordInvalid": # defunct + error = AccountError(AccountErrorEnum.FAILED_AUTHENTICATION) + elif code == "SSO_AuthenticateMaxAttemptsExceeded": + error = AccountError(AccountErrorEnum.MAX_ATTEMPTS) + elif code == "SSO_InternalError": + if message and ( + "Cannot Authenticate by AccountName" in message + or "Cannot Authenticate by AccountId" in message + ): + error = AccountError(AccountErrorEnum.FAILED_AUTHENTICATION) + elif code == "InvalidArgument": + if message and "accountName" in message: + error = ArgumentError(ArgumentErrorEnum.USERNAME_INVALID) + elif message and "password" in message: + error = ArgumentError(ArgumentErrorEnum.PASSWORD_INVALID) + elif message and "UUID" in message: + error = ArgumentError(ArgumentErrorEnum.ACCOUNT_ID_INVALID) + elif code and message: + _LOGGER.debug("%s: %s", code, message) + return error + + def _validate_region(self, region: Region) -> None: + if region not in list(Region): + raise ArgumentError(ArgumentErrorEnum.REGION_INVALID) + + def _validate_user_ids(self, account_id: str | None, username: str | None) -> None: + user_ids = sum(user_id is not None for user_id in [account_id, username]) + if user_ids == 0: + raise ArgumentError(ArgumentErrorEnum.USER_ID_REQUIRED) + if user_ids != 1: + raise ArgumentError(ArgumentErrorEnum.USER_ID_MULTIPLE) + + def _validate_session_id(self) -> None: + """Validate session ID.""" + if any( + [ + not isinstance(self._session_id, str), + not self._session_id, + not valid_uuid(self._session_id), + ], + ): + raise ArgumentError(ArgumentErrorEnum.SESSION_ID_INVALID) + if self._session_id == DEFAULT_UUID: + raise ArgumentError(ArgumentErrorEnum.SESSION_ID_DEFAULT) + + def _validate_username(self) -> None: + """Validate username.""" + if any([not isinstance(self._username, str), not self._username]): + raise ArgumentError(ArgumentErrorEnum.USERNAME_INVALID) + + def _validate_password(self) -> None: + """Validate password.""" + if any([not isinstance(self._password, str), not self._password]): + raise ArgumentError(ArgumentErrorEnum.PASSWORD_INVALID) + + def _validate_account_id(self) -> None: + """Validate account ID.""" + if any( + [ + not isinstance(self._account_id, str), + not self._account_id, + not valid_uuid(self._account_id), + ], + ): + raise ArgumentError(ArgumentErrorEnum.ACCOUNT_ID_INVALID) + if self._account_id == DEFAULT_UUID: + raise ArgumentError(ArgumentErrorEnum.ACCOUNT_ID_DEFAULT) + + def _validate_minutes_max_count(self, minutes: int, max_count: int) -> None: + if not isinstance(minutes, int) or any([minutes < 0, minutes > MAX_MINUTES]): + raise ArgumentError(ArgumentErrorEnum.MINUTES_INVALID) + if not isinstance(max_count, int) or any( + [max_count < 0, max_count > MAX_MAX_COUNT], + ): + raise ArgumentError(ArgumentErrorEnum.MAX_COUNT_INVALID) + + @property + def _authenticate_endpoint_arguments(self) -> dict[str, Any]: + return { + "endpoint": DEXCOM_AUTHENTICATE_ENDPOINT, + "json": { + "accountName": self._username, + "password": self._password, + "applicationId": self._application_id, + }, + } + + @property + def _login_id_endpoint_arguments(self) -> dict[str, Any]: + return { + "endpoint": DEXCOM_LOGIN_ID_ENDPOINT, + "json": { + "accountId": self._account_id, + "password": self._password, + "applicationId": self._application_id, + }, + } + + def _glucose_readings_endpoint_arguments( + self, + minutes: int = MAX_MINUTES, + max_count: int = MAX_MAX_COUNT, + ) -> dict[str, Any]: + return { + "endpoint": DEXCOM_GLUCOSE_READINGS_ENDPOINT, + "params": { + "sessionId": self._session_id, + "minutes": minutes, + "maxCount": max_count, + }, + } + + def _get_account_id(self) -> str: + """ + Retrieve account ID from the authentication endpoint. + + See `pydexcom.const.DEXCOM_AUTHENTICATE_ENDPOINT`. + """ + _LOGGER.debug("Retrieve account ID from the authentication endpoint") + return self._post(**self._authenticate_endpoint_arguments) + + def _get_session_id(self) -> str: + """ + Retrieve session ID from the login endpoint. + + See `pydexcom.const.DEXCOM_LOGIN_ID_ENDPOINT`. + """ + _LOGGER.debug("Retrieve session ID from the login endpoint") + return self._post(**self._login_id_endpoint_arguments) + + def _get_session(self) -> None: + """Create Dexcom Share API session.""" + self._validate_password() + + if self._account_id is None: + self._validate_username() + self._account_id = self._get_account_id() + + self._validate_account_id() + self._session_id = self._get_session_id() + self._validate_session_id() + + def _get_glucose_readings( + self, + minutes: int = MAX_MINUTES, + max_count: int = MAX_MAX_COUNT, + ) -> list[dict[str, Any]]: + """ + Retrieve glucose readings from the glucose readings endpoint. + + See `pydexcom.const.DEXCOM_GLUCOSE_READINGS_ENDPOINT`. + """ + _LOGGER.debug("Retrieve glucose readings from the glucose readings endpoint") + self._validate_minutes_max_count(minutes, max_count) + + return self._post( + **self._glucose_readings_endpoint_arguments(minutes, max_count), + ) + + def get_glucose_readings( + self, + minutes: int = MAX_MINUTES, + max_count: int = MAX_MAX_COUNT, + ) -> list[GlucoseReading]: + """ + Get `max_count` glucose readings within specified number of `minutes`. + + Catches one instance of a thrown `pydexcom.errors.SessionError` if session ID + expired, attempts to get a new session ID and retries. + + :param minutes: Number of minutes to retrieve glucose readings from (1-1440) + :param max_count: Maximum number of glucose readings to retrieve (1-288) + """ + json_glucose_readings: list[dict[str, Any]] = [] + + try: + # Requesting glucose reading with DEFAULT_UUID returns non-JSON empty string + self._validate_session_id() + json_glucose_readings = self._get_glucose_readings(minutes, max_count) + except SessionError: + # Attempt to update expired session ID + self._get_session() + json_glucose_readings = self._get_glucose_readings(minutes, max_count) + + return [GlucoseReading(json_reading) for json_reading in json_glucose_readings] + + def get_latest_glucose_reading(self) -> GlucoseReading | None: + """Get latest available glucose reading, within the last 24 hours.""" + return next(iter(self.get_glucose_readings(max_count=1)), None) + + def get_current_glucose_reading(self) -> GlucoseReading | None: + """Get current available glucose reading, within the last 10 minutes.""" + return next(iter(self.get_glucose_readings(minutes=10, max_count=1)), None) diff --git a/pydexcom/errors.py b/pydexcom/errors.py index e744637..60b6e40 100644 --- a/pydexcom/errors.py +++ b/pydexcom/errors.py @@ -27,9 +27,10 @@ class ArgumentErrorEnum(DexcomErrorEnum): MINUTES_INVALID = "Minutes must be and integer between 1 and 1440" MAX_COUNT_INVALID = "Max count must be and integer between 1 and 288" USERNAME_INVALID = "Username must be non-empty string" - TOO_MANY_USER_ID_PROVIDED = "Only one of account_id, username should be provided" - NONE_USER_ID_PROVIDED = "At least one of account_id, username should be provided" + USER_ID_MULTIPLE = "Only one of account_id, username should be provided" + USER_ID_REQUIRED = "At least one of account_id, username should be provided" PASSWORD_INVALID = "Password must be non-empty string" # noqa: S105 + REGION_INVALID = "Region must be 'us', 'ous, or 'jp'" ACCOUNT_ID_INVALID = "Account ID must be UUID" ACCOUNT_ID_DEFAULT = "Account ID default" SESSION_ID_INVALID = "Session ID must be UUID" @@ -41,7 +42,8 @@ class DexcomError(Exception): """Base class for all `pydexcom` errors.""" def __init__(self, enum: DexcomErrorEnum) -> None: - """Create `DexcomError` from `DexcomErrorEnum`. + """ + Create `DexcomError` from `DexcomErrorEnum`. :param enum: associated `DexcomErrorEnum` """ @@ -50,7 +52,8 @@ def __init__(self, enum: DexcomErrorEnum) -> None: @property def enum(self) -> DexcomErrorEnum: - """Get `DexcomErrorEnum` associated with error. + """ + Get `DexcomErrorEnum` associated with error. :return: `DexcomErrorEnum` """ diff --git a/pydexcom/glucose_reading.py b/pydexcom/glucose_reading.py new file mode 100644 index 0000000..8eddcbe --- /dev/null +++ b/pydexcom/glucose_reading.py @@ -0,0 +1,108 @@ +"""GlucoseReading class implementation.""" + +from __future__ import annotations + +import re +from datetime import datetime +from typing import Any + +from .const import ( + DEXCOM_TREND_DIRECTIONS, + MMOL_L_CONVERSION_FACTOR, + TREND_ARROWS, + TREND_DESCRIPTIONS, +) +from .errors import ( + ArgumentError, + ArgumentErrorEnum, +) + + +class GlucoseReading: + """Class for parsing glucose reading from Dexcom Share API.""" + + def __init__(self, json_glucose_reading: dict[str, Any]) -> None: + """ + Initialize `GlucoseReading` with JSON glucose reading from Dexcom Share API. + + :param json_glucose_reading: JSON glucose reading from Dexcom Share API + """ + self._json = json_glucose_reading + try: + self._value = int(json_glucose_reading["Value"]) + self._trend_direction: str = json_glucose_reading["Trend"] + # Dexcom Share API returns `str` direction now, previously `int` trend + self._trend: int = DEXCOM_TREND_DIRECTIONS[self._trend_direction] + + match = re.match( + r"Date\((?P\d+)(?P[+-]\d{4})\)", + json_glucose_reading["DT"], + ) + if match: + self._datetime = datetime.fromtimestamp( + int(match.group("timestamp")) / 1000.0, + tz=datetime.strptime(match.group("timezone"), "%z").tzinfo, + ) + except (KeyError, TypeError, ValueError) as error: + raise ArgumentError(ArgumentErrorEnum.GLUCOSE_READING_INVALID) from error + + @property + def value(self) -> int: + """Blood glucose value in mg/dL.""" + return self._value + + @property + def mg_dl(self) -> int: + """Blood glucose value in mg/dL.""" + return self._value + + @property + def mmol_l(self) -> float: + """Blood glucose value in mmol/L.""" + return round(self.value * MMOL_L_CONVERSION_FACTOR, 1) + + @property + def trend(self) -> int: + """ + Blood glucose trend information. + + Value of `pydexcom.const.DEXCOM_TREND_DIRECTIONS`. + """ + return self._trend + + @property + def trend_direction(self) -> str: + """ + Blood glucose trend direction. + + Key of `pydexcom.const.DEXCOM_TREND_DIRECTIONS`. + """ + return self._trend_direction + + @property + def trend_description(self) -> str | None: + """ + Blood glucose trend information description. + + See `pydexcom.const.TREND_DESCRIPTIONS`. + """ + return TREND_DESCRIPTIONS[self._trend] + + @property + def trend_arrow(self) -> str: + """Blood glucose trend as unicode arrow (`pydexcom.const.TREND_ARROWS`).""" + return TREND_ARROWS[self._trend] + + @property + def datetime(self) -> datetime: + """Glucose reading recorded time as datetime.""" + return self._datetime + + @property + def json(self) -> dict[str, Any]: + """JSON glucose reading from Dexcom Share API.""" + return self._json + + def __str__(self) -> str: + """Blood glucose value as in mg/dL.""" + return str(self._value) diff --git a/pydexcom/py.typed b/pydexcom/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/pydexcom/util.py b/pydexcom/util.py new file mode 100644 index 0000000..29b69b5 --- /dev/null +++ b/pydexcom/util.py @@ -0,0 +1,18 @@ +"""Utilities for pydexcom.""" + +from __future__ import annotations + +import logging +from uuid import UUID + +_LOGGER = logging.getLogger("pydexcom") + + +def valid_uuid(uuid: str | None) -> bool: + """Check if UUID is valid.""" + try: + UUID(str(uuid)) + except ValueError: + return False + else: + return True diff --git a/pyproject.toml b/pyproject.toml index ba850fb..9ffc6bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ authors = [ ] description = "Python API to interact with Dexcom Share API" readme = "README.md" -requires-python = ">= 3.9" +requires-python = ">=3.9" keywords = ["dexcom"] license = {text = "MIT"} dependencies = [ @@ -20,17 +20,45 @@ dynamic = ["version"] [tool.hatch.version] source = "vcs" +[tool.hatch.envs.default] +installer = "uv" +extra-dependencies = [ + "pre-commit", + "ruff", + "mypy", +] + +[tool.hatch.envs.hatch-test] +extra-dependencies = [ + "vcrpy~=7.0.0", +] + +[[tool.hatch.envs.hatch-test.matrix]] +python = ["3.13", "3.12", "3.11", "3.10", "3.9"] + +[tool.hatch.envs.docs] +dependencies = [ + "pdoc" +] +[tool.hatch.envs.docs.scripts] +build = "pdoc -o docs pydexcom" +serve = "pdoc pydexcom" + [tool.ruff] fix = true -extend-exclude = ["tests"] + +[tool.ruff.lint.per-file-ignores] +"tests/**/*.py" = ["S101", "SLF001"] [tool.ruff.format] docstring-code-format = true [tool.ruff.lint] +ignore = ["FA100", "D212", "D203", "COM812"] select = ["ALL"] [tool.mypy] +mypy_path = "stubs" ignore_missing_imports = true disallow_untyped_calls = true disallow_untyped_defs = true diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index d5d5757..0000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -requests>=2.0 \ No newline at end of file diff --git a/stubs/vcr/__init__.pyi b/stubs/vcr/__init__.pyi new file mode 100644 index 0000000..ad75098 --- /dev/null +++ b/stubs/vcr/__init__.pyi @@ -0,0 +1,51 @@ +# ruff: noqa: UP007, ANN401 +from typing import Any, Callable, Union + +from typing_extensions import TypeAlias +from vcr.cassette import Cassette +from vcr.record_mode import RecordMode +from vcr.request import Request + +Filter: TypeAlias = list[ + Union[ + list[str], + tuple[str, str], + tuple[str, None], + tuple[ + str, + Callable[[str, Any, Request], Union[str, None]], + ], + ], +] + +BeforeRecordRequestCallback: TypeAlias = Callable[ + [Request], + Union[Request, None], +] + +BeforeRecordResponseCallback: TypeAlias = Callable[ + [dict[str, Any]], + Union[dict[str, Any], None], +] + +class VCR: + def __init__( + self, + cassette_library_dir: Union[str, None] = ..., + path_transformer: Union[Callable[[str], str], None] = ..., + record_mode: Union[RecordMode, None] = ..., + match_on: Union[list[str], None] = ..., + filter_headers: Union[Filter, None] = ..., + filter_query_parameters: Union[Filter, None] = ..., + filter_post_data_parameters: Union[Filter, None] = ..., + ignore_hosts: Union[list[str], None] = ..., + ignore_localhost: bool = ..., + ignore_errors: bool = ..., + before_record_request: Union[BeforeRecordRequestCallback, None] = ..., + before_record_response: Union[BeforeRecordResponseCallback, None] = ..., + ) -> None: ... + def use_cassette( + self, + path: Union[str, None] = ..., + **kwargs: Any, + ) -> Cassette: ... diff --git a/stubs/vcr/cassette/__init__.pyi b/stubs/vcr/cassette/__init__.pyi new file mode 100644 index 0000000..fb22cd6 --- /dev/null +++ b/stubs/vcr/cassette/__init__.pyi @@ -0,0 +1,12 @@ +# ruff: noqa: UP007, ANN401 +from types import TracebackType +from typing import Self, Union + +class Cassette: + def __enter__(self) -> Self: ... + def __exit__( + self, + exc_type: Union[type[BaseException], None], + exc_val: Union[BaseException, None], + exc_tb: Union[TracebackType, None], + ) -> None: ... diff --git a/stubs/vcr/record_mode/__init__.pyi b/stubs/vcr/record_mode/__init__.pyi new file mode 100644 index 0000000..c1cddf3 --- /dev/null +++ b/stubs/vcr/record_mode/__init__.pyi @@ -0,0 +1,7 @@ +from enum import StrEnum + +class RecordMode(StrEnum): + ALL = ... + NEW_EPISODES = ... + NONE = ... + ONCE = ... diff --git a/stubs/vcr/request/__init__.pyi b/stubs/vcr/request/__init__.pyi new file mode 100644 index 0000000..2eda7fc --- /dev/null +++ b/stubs/vcr/request/__init__.pyi @@ -0,0 +1 @@ +class Request: ... diff --git a/tests/__init__.py b/tests/__init__.py index e69de29..454c4c1 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -0,0 +1 @@ +"""Tests for the pydexcom package.""" diff --git a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None--p@$$w0rd].yaml b/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None--p@$$w0rd].yaml deleted file mode 100644 index bf90d9f..0000000 --- a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None--p@$$w0rd].yaml +++ /dev/null @@ -1,60 +0,0 @@ -interactions: -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": - "", "password": "p@$$w0rd"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '105' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById - response: - body: - string: '"00000000-0000-0000-0000-000000000000"' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a673fdc9d684cb4-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '38' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:59:38 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Origin, - Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - 11e1aca6-ce38-4317-aa23-cc507101fbfd - x-xss-protection: - - '0' - status: - code: 200 - message: OK -version: 1 diff --git a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None--password].yaml b/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None--password].yaml deleted file mode 100644 index cb238c9..0000000 --- a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None--password].yaml +++ /dev/null @@ -1,60 +0,0 @@ -interactions: -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": - "", "password": "password"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '98' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById - response: - body: - string: '"00000000-0000-0000-0000-000000000000"' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a673fdb299b4cae-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '38' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:59:38 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Origin, - Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - 14ee4e99-71b6-44fb-8727-42ffc40e550d - x-xss-protection: - - '0' - status: - code: 200 - message: OK -version: 1 diff --git a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None-00000000-0000-0000-0000-000000000000-p@$$w0rd].yaml b/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None-00000000-0000-0000-0000-000000000000-p@$$w0rd].yaml deleted file mode 100644 index ec2358e..0000000 --- a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None-00000000-0000-0000-0000-000000000000-p@$$w0rd].yaml +++ /dev/null @@ -1,60 +0,0 @@ -interactions: -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": - "00000000-0000-0000-0000-000000000000", "password": "p@$$w0rd"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '141' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById - response: - body: - string: '"00000000-0000-0000-0000-000000000000"' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a673fe0afe332d2-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '38' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:59:39 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Origin, - Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - e442e8f1-e918-4c1a-bda8-4fca8c128c0b - x-xss-protection: - - '0' - status: - code: 200 - message: OK -version: 1 diff --git a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None-00000000-0000-0000-0000-000000000000-password].yaml b/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None-00000000-0000-0000-0000-000000000000-password].yaml deleted file mode 100644 index c6120df..0000000 --- a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None-00000000-0000-0000-0000-000000000000-password].yaml +++ /dev/null @@ -1,60 +0,0 @@ -interactions: -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": - "00000000-0000-0000-0000-000000000000", "password": "password"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '134' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById - response: - body: - string: '"00000000-0000-0000-0000-000000000000"' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a673fdfdbfd4caf-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '38' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:59:38 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Origin, - Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - 1deea616-e2cb-4e13-a4a5-68f65b082072 - x-xss-protection: - - '0' - status: - code: 200 - message: OK -version: 1 diff --git a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None-1-p@$$w0rd].yaml b/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None-1-p@$$w0rd].yaml deleted file mode 100644 index 9fff5c9..0000000 --- a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None-1-p@$$w0rd].yaml +++ /dev/null @@ -1,70 +0,0 @@ -interactions: -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": - 1, "password": "p@$$w0rd"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '104' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById - response: - body: - string: '{"Code":"InvalidArgument","Message":"Missing required field(s): JSON - parse error: Cannot deserialize value of type `java.util.UUID` from String - \"1\": UUID has to be represented by standard 36-char representation","SubCode":"","TypeName":"FaultException"}' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a673fdedf8e4cb1-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '1032' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:59:38 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - 3076466e-be4f-4147-a965-de177599618c - x-xss-protection: - - '0' - status: - code: 500 - message: Internal Server Error -version: 1 diff --git a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None-1-password].yaml b/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None-1-password].yaml deleted file mode 100644 index 63c24d2..0000000 --- a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None-1-password].yaml +++ /dev/null @@ -1,70 +0,0 @@ -interactions: -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": - 1, "password": "password"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '97' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById - response: - body: - string: '{"Code":"InvalidArgument","Message":"Missing required field(s): JSON - parse error: Cannot deserialize value of type `java.util.UUID` from String - \"1\": UUID has to be represented by standard 36-char representation","SubCode":"","TypeName":"FaultException"}' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a673fddcb8f32c8-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '1032' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:59:38 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - 6efc718f-38af-4d95-92bd-2fa4ee481fe0 - x-xss-protection: - - '0' - status: - code: 500 - message: Internal Server Error -version: 1 diff --git a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None-55555555-5555-5555-5555-555555555555-p@$$w0rd].yaml b/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None-55555555-5555-5555-5555-555555555555-p@$$w0rd].yaml deleted file mode 100644 index c8e2f33..0000000 --- a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None-55555555-5555-5555-5555-555555555555-p@$$w0rd].yaml +++ /dev/null @@ -1,146 +0,0 @@ -interactions: -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": - "55555555-5555-5555-5555-555555555555", "password": "p@$$w0rd"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '141' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById - response: - body: - string: '{"Code":"SSO_InternalError","Message":"Synchronization of SSO account - during authenticate call failed Time out issue. AccountId=55555555-5555-5555-5555-555555555555 - Error encountered accessing Keycloak endpoint: UAM_ERROR: HttpStatus=''401 - UNAUTHORIZED(401)'' Msg=Cannot Authenticate by AccountId=''55555555-5555-5555-5555-555555555555''","SubCode":"","TypeName":"FaultException"}' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a67a048bbe132cc-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '1389' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 02:05:28 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - b4822e47-6764-41db-99fb-b52bdaa46511 - x-xss-protection: - - '0' - status: - code: 500 - message: Internal Server Error -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": - "55555555-5555-5555-5555-555555555555", "password": "p@$$w0rd"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '141' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById - response: - body: - string: '{"Code":"SSO_InternalError","Message":"Synchronization of SSO account - during authenticate call failed Time out issue. AccountId=55555555-5555-5555-5555-555555555555 - Error encountered accessing Keycloak endpoint: UAM_ERROR: HttpStatus=''401 - UNAUTHORIZED(401)'' Msg=Cannot Authenticate by AccountId=''55555555-5555-5555-5555-555555555555''","SubCode":"","TypeName":"FaultException"}' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a67babeeb0932c6-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '1389' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 02:23:32 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - cb669f78-a250-403c-8a5e-cf88ef861e0d - x-xss-protection: - - '0' - status: - code: 500 - message: Internal Server Error -version: 1 diff --git a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None-55555555-5555-5555-5555-555555555555-password].yaml b/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None-55555555-5555-5555-5555-555555555555-password].yaml deleted file mode 100644 index e9b74f9..0000000 --- a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None-55555555-5555-5555-5555-555555555555-password].yaml +++ /dev/null @@ -1,146 +0,0 @@ -interactions: -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": - "55555555-5555-5555-5555-555555555555", "password": "password"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '134' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById - response: - body: - string: '{"Code":"SSO_InternalError","Message":"Synchronization of SSO account - during authenticate call failed Time out issue. AccountId=55555555-5555-5555-5555-555555555555 - Error encountered accessing Keycloak endpoint: UAM_ERROR: HttpStatus=''401 - UNAUTHORIZED(401)'' Msg=Cannot Authenticate by AccountId=''55555555-5555-5555-5555-555555555555''","SubCode":"","TypeName":"FaultException"}' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a67a04698a94cb6-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '1389' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 02:05:27 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - 9de15999-6e00-4aa2-a270-08cd2bcd938f - x-xss-protection: - - '0' - status: - code: 500 - message: Internal Server Error -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": - "55555555-5555-5555-5555-555555555555", "password": "password"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '134' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById - response: - body: - string: '{"Code":"SSO_InternalError","Message":"Synchronization of SSO account - during authenticate call failed Time out issue. AccountId=55555555-5555-5555-5555-555555555555 - Error encountered accessing Keycloak endpoint: UAM_ERROR: HttpStatus=''401 - UNAUTHORIZED(401)'' Msg=Cannot Authenticate by AccountId=''55555555-5555-5555-5555-555555555555''","SubCode":"","TypeName":"FaultException"}' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a67babc0f216991-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '1389' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 02:23:31 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - 335367a9-5283-4d2d-9ff1-9a1e7831a94f - x-xss-protection: - - '0' - status: - code: 500 - message: Internal Server Error -version: 1 diff --git a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None-99999999-9999-9999-9999-999999999999-password].yaml b/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None-99999999-9999-9999-9999-999999999999-password].yaml deleted file mode 100644 index 9c35957..0000000 --- a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None-99999999-9999-9999-9999-999999999999-password].yaml +++ /dev/null @@ -1,146 +0,0 @@ -interactions: -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": - "99999999-9999-9999-9999-999999999999", "password": "password"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '134' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById - response: - body: - string: '{"Code":"SSO_InternalError","Message":"Synchronization of SSO account - during authenticate call failed Time out issue. AccountId=99999999-9999-9999-9999-999999999999 - Error encountered accessing Keycloak endpoint: UAM_ERROR: HttpStatus=''401 - UNAUTHORIZED(401)'' Msg=Cannot Authenticate by AccountId=''99999999-9999-9999-9999-999999999999''","SubCode":"","TypeName":"FaultException"}' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a673fe19b964cb1-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '1389' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:59:39 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - baf88246-faf1-4d3b-8458-9f5d754235e4 - x-xss-protection: - - '0' - status: - code: 500 - message: Internal Server Error -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": - "99999999-9999-9999-9999-999999999999", "password": "password"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '134' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById - response: - body: - string: '{"Code":"SSO_InternalError","Message":"Synchronization of SSO account - during authenticate call failed Time out issue. AccountId=99999999-9999-9999-9999-999999999999 - Error encountered accessing Keycloak endpoint: UAM_ERROR: HttpStatus=''401 - UNAUTHORIZED(401)'' Msg=Cannot Authenticate by AccountId=''99999999-9999-9999-9999-999999999999''","SubCode":"","TypeName":"FaultException"}' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a67bac21a7a4cb1-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '1389' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 02:23:32 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - a23435b0-45ef-4d4a-b31a-6b8133da58a9 - x-xss-protection: - - '0' - status: - code: 500 - message: Internal Server Error -version: 1 diff --git a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[u$ern@me-None-password].yaml b/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[u$ern@me-None-password].yaml deleted file mode 100644 index 3acb96d..0000000 --- a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[u$ern@me-None-password].yaml +++ /dev/null @@ -1,146 +0,0 @@ -interactions: -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountName": - "u$ern@me", "password": "password"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '109' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/AuthenticatePublisherAccount - response: - body: - string: '{"Code":"SSO_InternalError","Message":"Synchronization of SSO account - during authenticate call failed Time out issue. AccountName=u$ern@me Error - encountered accessing Keycloak endpoint: UAM_ERROR: HttpStatus=''401 UNAUTHORIZED(401)'' - Msg=Cannot Authenticate by AccountName=''u$ern@me''","SubCode":"","TypeName":"FaultException"}' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a673ff359e14caf-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '1237' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:59:42 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - 0bcdc445-8f7c-4927-9438-eccd0d2f2890 - x-xss-protection: - - '0' - status: - code: 500 - message: Internal Server Error -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountName": - "u$ern@me", "password": "password"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '109' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/AuthenticatePublisherAccount - response: - body: - string: '{"Code":"SSO_InternalError","Message":"Synchronization of SSO account - during authenticate call failed Time out issue. AccountName=u$ern@me Error - encountered accessing Keycloak endpoint: UAM_ERROR: HttpStatus=''401 UNAUTHORIZED(401)'' - Msg=Cannot Authenticate by AccountName=''u$ern@me''","SubCode":"","TypeName":"FaultException"}' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a67bad4cdb032c6-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '1237' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 02:23:35 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - aa1524db-541c-43d0-b71e-bd989c2b3af2 - x-xss-protection: - - '0' - status: - code: 500 - message: Internal Server Error -version: 1 diff --git a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[username-None-p@$$w0rd].yaml b/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[username-None-p@$$w0rd].yaml deleted file mode 100644 index b3542d3..0000000 --- a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[username-None-p@$$w0rd].yaml +++ /dev/null @@ -1,146 +0,0 @@ -interactions: -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountName": - "username", "password": "p@$$w0rd"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '115' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/AuthenticatePublisherAccount - response: - body: - string: '{"Code":"SSO_InternalError","Message":"Synchronization of SSO account - during authenticate call failed Time out issue. AccountName=username Error - encountered accessing Keycloak endpoint: UAM_ERROR: HttpStatus=''401 UNAUTHORIZED(401)'' - Msg=Cannot Authenticate by AccountName=''username''","SubCode":"","TypeName":"FaultException"}' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a673ff078b832d2-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '1233' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:59:41 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - 3f0e41b9-6d51-4f97-939e-bea63cf5c857 - x-xss-protection: - - '0' - status: - code: 500 - message: Internal Server Error -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountName": - "username", "password": "p@$$w0rd"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '115' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/AuthenticatePublisherAccount - response: - body: - string: '{"Code":"SSO_InternalError","Message":"Synchronization of SSO account - during authenticate call failed Time out issue. AccountName=username Error - encountered accessing Keycloak endpoint: UAM_ERROR: HttpStatus=''401 UNAUTHORIZED(401)'' - Msg=Cannot Authenticate by AccountName=''username''","SubCode":"","TypeName":"FaultException"}' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a67bad15aab32c8-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '1233' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 02:23:35 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - 6da55f77-f82b-480b-97d1-560b105829c5 - x-xss-protection: - - '0' - status: - code: 500 - message: Internal Server Error -version: 1 diff --git a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[username-None-password].yaml b/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[username-None-password].yaml deleted file mode 100644 index 9313834..0000000 --- a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[username-None-password].yaml +++ /dev/null @@ -1,146 +0,0 @@ -interactions: -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountName": - "username", "password": "password"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '108' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/AuthenticatePublisherAccount - response: - body: - string: '{"Code":"SSO_InternalError","Message":"Synchronization of SSO account - during authenticate call failed Time out issue. AccountName=username Error - encountered accessing Keycloak endpoint: UAM_ERROR: HttpStatus=''401 UNAUTHORIZED(401)'' - Msg=Cannot Authenticate by AccountName=''username''","SubCode":"","TypeName":"FaultException"}' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a673fed7bce32cc-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '1233' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:59:41 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - fd2b0b1e-afd5-4d64-8fe6-e51d04b3c10c - x-xss-protection: - - '0' - status: - code: 500 - message: Internal Server Error -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountName": - "username", "password": "password"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '108' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/AuthenticatePublisherAccount - response: - body: - string: '{"Code":"SSO_InternalError","Message":"Synchronization of SSO account - during authenticate call failed Time out issue. AccountName=username Error - encountered accessing Keycloak endpoint: UAM_ERROR: HttpStatus=''401 UNAUTHORIZED(401)'' - Msg=Cannot Authenticate by AccountName=''username''","SubCode":"","TypeName":"FaultException"}' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a67bace999a4cae-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '1233' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 02:23:34 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - e3df828c-70e9-46c6-8984-d5aeca1014f7 - x-xss-protection: - - '0' - status: - code: 500 - message: Internal Server Error -version: 1 diff --git a/tests/cassettes/test_glucose_reading/TestGlucoseReading/dexcom.yaml b/tests/cassettes/test_glucose_reading/TestGlucoseReading/dexcom.yaml deleted file mode 100644 index 850af77..0000000 --- a/tests/cassettes/test_glucose_reading/TestGlucoseReading/dexcom.yaml +++ /dev/null @@ -1,502 +0,0 @@ -interactions: -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountName": - "u$ern@me", "password": "p@$$w0rd"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '116' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/AuthenticatePublisherAccount - response: - body: - string: '"99999999-9999-9999-9999-999999999999"' - headers: - CF-Cache-Status: - - DYNAMIC - CF-RAY: - - 7f295bd8ca63c40e-EWR - Connection: - - keep-alive - Content-Length: - - '38' - Content-Type: - - application/json - Date: - - Sun, 06 Aug 2023 18:31:47 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin - - Access-Control-Request-Method - - Access-Control-Request-Headers - X-Trace-Id: - - 231b4297-8820-40ad-9e1d-c8642e95caec - status: - code: 200 - message: OK -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": - "99999999-9999-9999-9999-999999999999", "password": "p@$$w0rd"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '141' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById - response: - body: - string: '"55555555-5555-5555-5555-555555555555"' - headers: - CF-Cache-Status: - - DYNAMIC - CF-RAY: - - 7f295bdb9e7b1a2c-EWR - Connection: - - keep-alive - Content-Length: - - '38' - Content-Type: - - application/json - Date: - - Sun, 06 Aug 2023 18:31:48 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin - - Access-Control-Request-Method - - Access-Control-Request-Headers - X-Trace-Id: - - 800dbcca-29e8-4485-9a98-f0d908028452 - status: - code: 200 - message: OK -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountName": - "u$ern@me", "password": "p@$$w0rd"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '116' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/AuthenticatePublisherAccount - response: - body: - string: '"99999999-9999-9999-9999-999999999999"' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a6738b64ee832b3-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '38' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:54:46 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Origin, - Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - 8074a08b-c8a6-40ae-991b-cd176a31c005 - x-xss-protection: - - '0' - status: - code: 200 - message: OK -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": - "99999999-9999-9999-9999-999999999999", "password": "p@$$w0rd"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '141' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById - response: - body: - string: '"55555555-5555-5555-5555-555555555555"' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a6738bb29554caf-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '38' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:54:46 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Origin, - Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - 87ddc644-9667-4be8-b243-83afe9a6984d - x-xss-protection: - - '0' - status: - code: 200 - message: OK -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountName": - "u$ern@me", "password": "p@$$w0rd"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '116' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/AuthenticatePublisherAccount - response: - body: - string: '"99999999-9999-9999-9999-999999999999"' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a673b76b94532cc-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '38' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:56:38 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Origin, - Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - a87680da-04c2-4eae-9c9e-ae3a327d7080 - x-xss-protection: - - '0' - status: - code: 200 - message: OK -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": - "99999999-9999-9999-9999-999999999999", "password": "p@$$w0rd"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '141' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById - response: - body: - string: '"55555555-5555-5555-5555-555555555555"' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a673b7b2ceb4cac-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '38' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:56:39 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Origin, - Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - 01818427-ef81-467c-89a7-c511a4750370 - x-xss-protection: - - '0' - status: - code: 200 - message: OK -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountName": - "u$ern@me", "password": "p@$$w0rd"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '116' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/AuthenticatePublisherAccount - response: - body: - string: '"99999999-9999-9999-9999-999999999999"' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a6740027cf44cb1-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '38' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:59:44 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Origin, - Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - fbf322b2-2d60-4f15-bff1-cb5e2ac06ab3 - x-xss-protection: - - '0' - status: - code: 200 - message: OK -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": - "99999999-9999-9999-9999-999999999999", "password": "p@$$w0rd"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '141' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById - response: - body: - string: '"55555555-5555-5555-5555-555555555555"' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a67400608076991-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '38' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:59:45 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Origin, - Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - fa146293-35af-4de3-9301-63c4aa738fec - x-xss-protection: - - '0' - status: - code: 200 - message: OK -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": - "99999999-9999-9999-9999-999999999999", "password": "p@$$w0rd"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '141' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById - response: - body: - string: '"55555555-5555-5555-5555-555555555555"' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a67bae2e8804caf-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '38' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 02:23:37 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Origin, - Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - da430cbd-5188-4855-974f-f2ff84c2a4c6 - x-xss-protection: - - '0' - status: - code: 200 - message: OK -version: 1 diff --git a/tests/cassettes/test_glucose_reading/TestGlucoseReading/test_get_current_glucose_reading.yaml b/tests/cassettes/test_glucose_reading/TestGlucoseReading/test_get_current_glucose_reading.yaml deleted file mode 100644 index a93d73a..0000000 --- a/tests/cassettes/test_glucose_reading/TestGlucoseReading/test_get_current_glucose_reading.yaml +++ /dev/null @@ -1,224 +0,0 @@ -interactions: -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[{"WT":"Date(1691346655000)","ST":"Date(1691346655000)","DT":"Date(1691346655000-0400)","Value":127,"Trend":"Flat"}]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-RAY: - - 7f295be4dd3d1927-EWR - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 06 Aug 2023 18:31:49 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin - - Access-Control-Request-Method - - Access-Control-Request-Headers - X-Trace-Id: - - 3a5c08ae-43a5-4120-8b55-08929aa1cb00 - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[{"WT":"Date(1721522993527)","ST":"Date(1721522993527)","DT":"Date(1721522993527-0400)","Value":311,"Trend":"FortyFiveUp"}]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a6738c578b54cac-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:54:48 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - d360a6c1-da78-4f01-816b-b045abf5786c - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[{"WT":"Date(1721523293100)","ST":"Date(1721523293100)","DT":"Date(1721523293100-0400)","Value":312,"Trend":"FortyFiveUp"}]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a673b85a9a14cb1-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:56:40 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - 5939eddc-eda0-4344-a704-776506e145d3 - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[{"WT":"Date(1721523293100)","ST":"Date(1721523293100)","DT":"Date(1721523293100-0400)","Value":312,"Trend":"FortyFiveUp"}]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a6740107c4a32d2-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:59:46 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - 04fd034e-56e1-4c2e-9eaf-76e2250d04ec - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[{"WT":"Date(1721528393435)","ST":"Date(1721528393435)","DT":"Date(1721528393435-0400)","Value":248,"Trend":"Flat"}]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a67baed080c32d2-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 02:23:39 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - 7ff586ab-e086-4e93-b833-c45d11844eee - status: - code: 200 - message: OK -version: 1 diff --git a/tests/cassettes/test_glucose_reading/TestGlucoseReading/test_get_current_glucose_reading_session_expired.yaml b/tests/cassettes/test_glucose_reading/TestGlucoseReading/test_get_current_glucose_reading_session_expired.yaml deleted file mode 100644 index 25cc69a..0000000 --- a/tests/cassettes/test_glucose_reading/TestGlucoseReading/test_get_current_glucose_reading_session_expired.yaml +++ /dev/null @@ -1,765 +0,0 @@ -interactions: -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=33333333-3333-3333-3333-333333333333 - response: - body: - string: '{"Code":"SessionIdNotFound","Message":"Failed to find session object. - [SessionId = 33333333-3333-3333-3333-333333333333]","SubCode":"","TypeName":"FaultException"}' - headers: - CF-Cache-Status: - - DYNAMIC - CF-RAY: - - 7f295be60e88428f-EWR - Connection: - - keep-alive - Content-Length: - - '738' - Content-Type: - - application/json - Date: - - Sun, 06 Aug 2023 18:31:49 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin - - Access-Control-Request-Method - - Access-Control-Request-Headers - X-Trace-Id: - - 0fcceb2a-295e-4cea-bcfa-5d98245ef27c - status: - code: 500 - message: Internal Server Error -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": - "99999999-9999-9999-9999-999999999999", "password": "p@$$w0rd"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '141' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById - response: - body: - string: '"55555555-5555-5555-5555-555555555555"' - headers: - CF-Cache-Status: - - DYNAMIC - CF-RAY: - - 7f295be73ff2c472-EWR - Connection: - - keep-alive - Content-Length: - - '38' - Content-Type: - - application/json - Date: - - Sun, 06 Aug 2023 18:31:49 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin - - Access-Control-Request-Method - - Access-Control-Request-Headers - X-Trace-Id: - - 81f15434-f717-40ff-82dd-f265c7331512 - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[{"WT":"Date(1691346655000)","ST":"Date(1691346655000)","DT":"Date(1691346655000-0400)","Value":127,"Trend":"Flat"}]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-RAY: - - 7f295bea288a42ee-EWR - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 06 Aug 2023 18:31:50 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin - - Access-Control-Request-Method - - Access-Control-Request-Headers - X-Trace-Id: - - 39a2002c-263a-4063-9d69-3a1613fa3f42 - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=33333333-3333-3333-3333-333333333333 - response: - body: - string: '{"Code":"SessionIdNotFound","Message":"Failed to find session object. - [SessionId = 33333333-3333-3333-3333-333333333333]","SubCode":"","TypeName":"FaultException"}' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a6738c6a87d4cb2-PHL - Connection: - - keep-alive - Content-Length: - - '750' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:54:48 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - c25d3f0d-0a1e-4ba5-940a-b6c67c2abe53 - status: - code: 500 - message: Internal Server Error -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": - "99999999-9999-9999-9999-999999999999", "password": "p@$$w0rd"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '141' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById - response: - body: - string: '"55555555-5555-5555-5555-555555555555"' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a6738c7b97132b3-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '38' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:54:48 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Origin, - Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - 904acb45-2b1e-4701-8578-977cbf9fd515 - x-xss-protection: - - '0' - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[{"WT":"Date(1721522993527)","ST":"Date(1721522993527)","DT":"Date(1721522993527-0400)","Value":311,"Trend":"FortyFiveUp"}]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a6738cbe85332c6-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:54:49 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - 7ec2b68a-6caf-45f2-a754-72ebb16960da - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=33333333-3333-3333-3333-333333333333 - response: - body: - string: '{"Code":"SessionIdNotFound","Message":"Failed to find session object. - [SessionId = 33333333-3333-3333-3333-333333333333]","SubCode":"","TypeName":"FaultException"}' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a673b86b9bc4cb6-PHL - Connection: - - keep-alive - Content-Length: - - '750' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:56:40 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - 4ce8ae68-c818-4e19-bb34-9a8134ad8d5a - status: - code: 500 - message: Internal Server Error -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": - "99999999-9999-9999-9999-999999999999", "password": "p@$$w0rd"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '141' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById - response: - body: - string: '"55555555-5555-5555-5555-555555555555"' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a673b87e86e4cb2-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '38' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:56:41 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Origin, - Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - ba943654-6cd8-4299-b3a2-d34c500ca823 - x-xss-protection: - - '0' - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[{"WT":"Date(1721523293100)","ST":"Date(1721523293100)","DT":"Date(1721523293100-0400)","Value":312,"Trend":"FortyFiveUp"}]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a673b8c6db732c8-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:56:41 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - 2cd004a7-db67-4a5f-8741-cc9335f118a7 - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=33333333-3333-3333-3333-333333333333 - response: - body: - string: '{"Code":"SessionIdNotFound","Message":"Failed to find session object. - [SessionId = 33333333-3333-3333-3333-333333333333]","SubCode":"","TypeName":"FaultException"}' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a674011ab304cb1-PHL - Connection: - - keep-alive - Content-Length: - - '750' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:59:46 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - ddc58043-be22-441a-8a2d-d123038cb65f - status: - code: 500 - message: Internal Server Error -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": - "99999999-9999-9999-9999-999999999999", "password": "p@$$w0rd"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '141' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById - response: - body: - string: '"55555555-5555-5555-5555-555555555555"' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a674012aee74cae-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '38' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:59:47 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Origin, - Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - 1fa5155e-6d53-4449-bce1-0f89f1febeee - x-xss-protection: - - '0' - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[{"WT":"Date(1721523293100)","ST":"Date(1721523293100)","DT":"Date(1721523293100-0400)","Value":312,"Trend":"FortyFiveUp"}]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a6740169e704cb2-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:59:47 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - 68d84d31-9a04-4c21-9a20-eaa14e953588 - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=33333333-3333-3333-3333-333333333333 - response: - body: - string: '{"Code":"SessionIdNotFound","Message":"Failed to find session object. - [SessionId = 33333333-3333-3333-3333-333333333333]","SubCode":"","TypeName":"FaultException"}' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a67baee8a8832d2-PHL - Connection: - - keep-alive - Content-Length: - - '750' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 02:23:39 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - 4f731b77-f872-4866-9d05-79fce7bb4d4f - status: - code: 500 - message: Internal Server Error -- request: - body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": - "99999999-9999-9999-9999-999999999999", "password": "p@$$w0rd"}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '141' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById - response: - body: - string: '"55555555-5555-5555-5555-555555555555"' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a67baef8c2132d2-PHL - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Connection: - - keep-alive - Content-Length: - - '38' - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 02:23:39 GMT - Expires: - - '0' - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Origin, - Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - pragma: - - no-cache - x-content-type-options: - - nosniff - x-frame-options: - - DENY - x-trace-id: - - d3240897-8de1-497c-b710-1aad7f8ce661 - x-xss-protection: - - '0' - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[{"WT":"Date(1721528393435)","ST":"Date(1721528393435)","DT":"Date(1721528393435-0400)","Value":248,"Trend":"Flat"}]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a67baf3edf24cb4-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 02:23:40 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - 2a8b080e-1dfb-4397-9bca-181c68991ea1 - status: - code: 200 - message: OK -version: 1 diff --git a/tests/cassettes/test_glucose_reading/TestGlucoseReading/test_get_glucose_readings[0-0].yaml b/tests/cassettes/test_glucose_reading/TestGlucoseReading/test_get_glucose_readings[0-0].yaml deleted file mode 100644 index 14f2e97..0000000 --- a/tests/cassettes/test_glucose_reading/TestGlucoseReading/test_get_glucose_readings[0-0].yaml +++ /dev/null @@ -1,224 +0,0 @@ -interactions: -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=0&minutes=0&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-RAY: - - 7f295bdebc0cc33e-EWR - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 06 Aug 2023 18:31:48 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin - - Access-Control-Request-Method - - Access-Control-Request-Headers - X-Trace-Id: - - 3b4abe3f-a830-44f3-868e-a97886954cff - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=0&minutes=0&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a6738bfac9c32d2-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:54:47 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - d776a579-7810-434f-9889-e0a9e79e41d1 - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=0&minutes=0&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a673b7f6f7f6991-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:56:39 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - 0e163f50-7515-4d93-a159-5f6e85ec9cef - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=0&minutes=0&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a67400b1ef132cc-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:59:45 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - f005da2d-bc33-46fe-8aaa-44b0e94d2ae6 - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=0&minutes=0&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a67bae74e5432b2-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 02:23:38 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - 062ee526-3dfd-4272-8520-c4e2be9353e2 - status: - code: 200 - message: OK -version: 1 diff --git a/tests/cassettes/test_glucose_reading/TestGlucoseReading/test_get_glucose_readings[0-10].yaml b/tests/cassettes/test_glucose_reading/TestGlucoseReading/test_get_glucose_readings[0-10].yaml deleted file mode 100644 index a90f8ce..0000000 --- a/tests/cassettes/test_glucose_reading/TestGlucoseReading/test_get_glucose_readings[0-10].yaml +++ /dev/null @@ -1,224 +0,0 @@ -interactions: -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=0&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-RAY: - - 7f295bdfdfc0183d-EWR - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 06 Aug 2023 18:31:48 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin - - Access-Control-Request-Method - - Access-Control-Request-Headers - X-Trace-Id: - - 3475cb2c-f0f1-480d-bf91-58bdf1198fa5 - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=0&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a6738c0a9654cb6-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:54:47 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - 8a8cce92-43e8-407b-b52f-c15a699df137 - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=0&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a673b807d614cac-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:56:39 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - f850ae15-96ea-4a77-88d4-4927302c4e8b - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=0&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a67400c295932b3-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:59:46 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - 9d48734d-57a3-4f45-9fb2-4d3e648dd085 - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=0&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a67bae89ad032c6-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 02:23:38 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - f73342bf-19ba-41c8-8ad8-c491289b8ea0 - status: - code: 200 - message: OK -version: 1 diff --git a/tests/cassettes/test_glucose_reading/TestGlucoseReading/test_get_glucose_readings[1-0].yaml b/tests/cassettes/test_glucose_reading/TestGlucoseReading/test_get_glucose_readings[1-0].yaml deleted file mode 100644 index 9ff766b..0000000 --- a/tests/cassettes/test_glucose_reading/TestGlucoseReading/test_get_glucose_readings[1-0].yaml +++ /dev/null @@ -1,224 +0,0 @@ -interactions: -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=0&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-RAY: - - 7f295be12e724331-EWR - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 06 Aug 2023 18:31:48 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin - - Access-Control-Request-Method - - Access-Control-Request-Headers - X-Trace-Id: - - 569ab306-54e8-4a7b-82d1-1fc8720786f5 - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=0&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a6738c1e8bf32b3-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:54:47 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - 43a5141f-2643-404f-8b4e-84862826350a - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=0&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a673b81da2832c5-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:56:40 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - cc8909ae-abd2-4db8-8dad-0d74a0a9b4ba - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=0&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a67400d49a532b2-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:59:46 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - 392375a8-dda2-4d98-87b6-a92f0b6b2427 - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=0&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a67bae99c3232c6-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 02:23:38 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - 49abd46e-bec1-4140-8ff7-f6ba72dfcecb - status: - code: 200 - message: OK -version: 1 diff --git a/tests/cassettes/test_glucose_reading/TestGlucoseReading/test_get_glucose_readings[1-10].yaml b/tests/cassettes/test_glucose_reading/TestGlucoseReading/test_get_glucose_readings[1-10].yaml deleted file mode 100644 index c1d6831..0000000 --- a/tests/cassettes/test_glucose_reading/TestGlucoseReading/test_get_glucose_readings[1-10].yaml +++ /dev/null @@ -1,224 +0,0 @@ -interactions: -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[{"WT":"Date(1691346655000)","ST":"Date(1691346655000)","DT":"Date(1691346655000-0400)","Value":127,"Trend":"Flat"}]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-RAY: - - 7f295be25fe94376-EWR - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 06 Aug 2023 18:31:48 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin - - Access-Control-Request-Method - - Access-Control-Request-Headers - X-Trace-Id: - - 590060d9-284f-4651-958a-851120207558 - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[{"WT":"Date(1721522993527)","ST":"Date(1721522993527)","DT":"Date(1721522993527-0400)","Value":311,"Trend":"FortyFiveUp"}]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a6738c32bfe32c6-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:54:47 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - 56b25db2-6f0c-403a-859c-74d34be36c08 - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[{"WT":"Date(1721523293100)","ST":"Date(1721523293100)","DT":"Date(1721523293100-0400)","Value":312,"Trend":"FortyFiveUp"}]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a673b831e2932b2-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:56:40 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - c4fcbe07-4e22-468d-9394-5483ca0d783e - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[{"WT":"Date(1721523293100)","ST":"Date(1721523293100)","DT":"Date(1721523293100-0400)","Value":312,"Trend":"FortyFiveUp"}]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a67400e6bd96991-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:59:46 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - 91fb061f-128f-4a9d-ae41-66c8b43de21c - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[{"WT":"Date(1721528393435)","ST":"Date(1721528393435)","DT":"Date(1721528393435-0400)","Value":248,"Trend":"Flat"}]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a67baeb0e214cb1-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 02:23:38 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - 0cf23c84-c121-412f-9973-b6a116b6f7a0 - status: - code: 200 - message: OK -version: 1 diff --git a/tests/cassettes/test_glucose_reading/TestGlucoseReading/test_get_latest_glucose_reading.yaml b/tests/cassettes/test_glucose_reading/TestGlucoseReading/test_get_latest_glucose_reading.yaml deleted file mode 100644 index 51635cc..0000000 --- a/tests/cassettes/test_glucose_reading/TestGlucoseReading/test_get_latest_glucose_reading.yaml +++ /dev/null @@ -1,224 +0,0 @@ -interactions: -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=1440&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[{"WT":"Date(1691346655000)","ST":"Date(1691346655000)","DT":"Date(1691346655000-0400)","Value":127,"Trend":"Flat"}]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-RAY: - - 7f295be39a7d4233-EWR - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 06 Aug 2023 18:31:49 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin - - Access-Control-Request-Method - - Access-Control-Request-Headers - X-Trace-Id: - - b28e23ac-7512-4c45-a1f6-e6a221c03143 - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=1440&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[{"WT":"Date(1721522993527)","ST":"Date(1721522993527)","DT":"Date(1721522993527-0400)","Value":311,"Trend":"FortyFiveUp"}]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a6738c43fe36991-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:54:47 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - 73308f20-9fcd-46dc-b6a8-ac361e2e3e89 - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=1440&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[{"WT":"Date(1721523293100)","ST":"Date(1721523293100)","DT":"Date(1721523293100-0400)","Value":312,"Trend":"FortyFiveUp"}]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a673b846e994cae-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:56:40 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - 6911ee52-f0d8-42ea-85fc-a1df9d27d72f - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=1440&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[{"WT":"Date(1721523293100)","ST":"Date(1721523293100)","DT":"Date(1721523293100-0400)","Value":312,"Trend":"FortyFiveUp"}]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a67400f6fee4cb1-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 00:59:46 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - 290f85e1-77e7-404d-a8a5-d6fe5eeaaaa7 - status: - code: 200 - message: OK -- request: - body: '{}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - application/json - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - User-Agent: - - python-requests/2.31.0 - method: POST - uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=1440&sessionId=55555555-5555-5555-5555-555555555555 - response: - body: - string: '[{"WT":"Date(1721528393435)","ST":"Date(1721528393435)","DT":"Date(1721528393435-0400)","Value":248,"Trend":"Flat"}]' - headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a67baec0de932b2-PHL - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Sun, 21 Jul 2024 02:23:38 GMT - Server: - - cloudflare - Strict-Transport-Security: - - max-age=0 - Transfer-Encoding: - - chunked - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding - x-trace-id: - - 2658406c-3e90-4b50-bfa5-e1499ef272d4 - status: - code: 200 - message: OK -version: 1 diff --git a/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[ous-None-77777777-7777-7777-7777-777777777777-p@$$w0rd]/test_dexcom[ous-None-77777777-7777-7777-7777-777777777777-p@$$w0rd].yaml b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[ous-None-77777777-7777-7777-7777-777777777777-p@$$w0rd]/test_dexcom[ous-None-77777777-7777-7777-7777-777777777777-p@$$w0rd].yaml new file mode 100644 index 0000000..95466a7 --- /dev/null +++ b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[ous-None-77777777-7777-7777-7777-777777777777-p@$$w0rd]/test_dexcom[ous-None-77777777-7777-7777-7777-777777777777-p@$$w0rd].yaml @@ -0,0 +1,132 @@ +interactions: +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": + "77777777-7777-7777-7777-777777777777", "password": "p@$$w0rd"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '141' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://shareous1.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 932de2c61a6d4cac-PHL + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 16:47:48 GMT + Server: + - cloudflare + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - 73373efe-b679-4b03-9863-9111ba6781ed + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": + "77777777-7777-7777-7777-777777777777", "password": "p@$$w0rd"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '141' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://shareous1.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-RAY: + - 9505310dde490c92-EWR + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Date: + - Sun, 15 Jun 2025 21:34:28 GMT + Server: + - cloudflare + cf-cache-status: + - DYNAMIC + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - a15a6431-926b-4a82-b120-6b035d17f8a7 + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +version: 1 diff --git a/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[ous-None-77777777-7777-7777-7777-777777777777-password]/test_dexcom[ous-None-77777777-7777-7777-7777-777777777777-password].yaml b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[ous-None-77777777-7777-7777-7777-777777777777-password]/test_dexcom[ous-None-77777777-7777-7777-7777-777777777777-password].yaml new file mode 100644 index 0000000..1708f71 --- /dev/null +++ b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[ous-None-77777777-7777-7777-7777-777777777777-password]/test_dexcom[ous-None-77777777-7777-7777-7777-777777777777-password].yaml @@ -0,0 +1,132 @@ +interactions: +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": + "77777777-7777-7777-7777-777777777777", "password": "password"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '134' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://shareous1.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-RAY: + - 932de2c10fd542cd-EWR + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '617' + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 16:47:47 GMT + Server: + - cloudflare + cf-cache-status: + - DYNAMIC + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - c38b2a93-9279-4a01-a304-5cc7efcf8257 + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": + "77777777-7777-7777-7777-777777777777", "password": "password"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '134' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://shareous1.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-RAY: + - 95053109bbfcc3eb-EWR + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Date: + - Sun, 15 Jun 2025 21:34:27 GMT + Server: + - cloudflare + cf-cache-status: + - DYNAMIC + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - 9931e080-e5e1-402a-b140-1b96f58d1d43 + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +version: 1 diff --git a/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[ous-None-99999999-9999-9999-9999-999999999999-p@$$w0rd]/test_dexcom[ous-None-99999999-9999-9999-9999-999999999999-p@$$w0rd].yaml b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[ous-None-99999999-9999-9999-9999-999999999999-p@$$w0rd]/test_dexcom[ous-None-99999999-9999-9999-9999-999999999999-p@$$w0rd].yaml new file mode 100644 index 0000000..5f183fd --- /dev/null +++ b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[ous-None-99999999-9999-9999-9999-999999999999-p@$$w0rd]/test_dexcom[ous-None-99999999-9999-9999-9999-999999999999-p@$$w0rd].yaml @@ -0,0 +1,132 @@ +interactions: +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": + "99999999-9999-9999-9999-999999999999", "password": "p@$$w0rd"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '141' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://shareous1.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-RAY: + - 932de2cf8c1a4229-EWR + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 16:47:50 GMT + Server: + - cloudflare + cf-cache-status: + - DYNAMIC + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - d66578a2-a2fc-4757-b3be-eb36cf1bfa95 + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": + "99999999-9999-9999-9999-999999999999", "password": "p@$$w0rd"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '141' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://shareous1.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-RAY: + - 95053115ba3cde9b-EWR + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Date: + - Sun, 15 Jun 2025 21:34:29 GMT + Server: + - cloudflare + cf-cache-status: + - DYNAMIC + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - 5fefa6cf-ee2d-4b4f-9eea-0360dac91ce5 + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +version: 1 diff --git a/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[ous-None-99999999-9999-9999-9999-999999999999-password]/test_dexcom[ous-None-99999999-9999-9999-9999-999999999999-password].yaml b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[ous-None-99999999-9999-9999-9999-999999999999-password]/test_dexcom[ous-None-99999999-9999-9999-9999-999999999999-password].yaml new file mode 100644 index 0000000..06be341 --- /dev/null +++ b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[ous-None-99999999-9999-9999-9999-999999999999-password]/test_dexcom[ous-None-99999999-9999-9999-9999-999999999999-password].yaml @@ -0,0 +1,132 @@ +interactions: +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": + "99999999-9999-9999-9999-999999999999", "password": "password"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '134' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://shareous1.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-RAY: + - 932de2c9a9f80f89-EWR + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 16:47:49 GMT + Server: + - cloudflare + cf-cache-status: + - DYNAMIC + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - cc53ec87-45dc-42d8-af38-647786bf73f8 + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": + "99999999-9999-9999-9999-999999999999", "password": "password"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '134' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://shareous1.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-RAY: + - 95053111ba73de97-EWR + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Date: + - Sun, 15 Jun 2025 21:34:28 GMT + Server: + - cloudflare + cf-cache-status: + - DYNAMIC + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - 36f8bc8e-2886-4be0-ba1d-e81b7e998b1e + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +version: 1 diff --git a/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[ous-u$ern@me-None-p@$$w0rd]/test_dexcom[ous-u$ern@me-None-p@$$w0rd].yaml b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[ous-u$ern@me-None-p@$$w0rd]/test_dexcom[ous-u$ern@me-None-p@$$w0rd].yaml new file mode 100644 index 0000000..ee129ef --- /dev/null +++ b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[ous-u$ern@me-None-p@$$w0rd]/test_dexcom[ous-u$ern@me-None-p@$$w0rd].yaml @@ -0,0 +1,132 @@ +interactions: +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountName": + "u$ern@me", "password": "p@$$w0rd"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '116' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://shareous1.dexcom.com/ShareWebServices/Services/General/AuthenticatePublisherAccount + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-RAY: + - 932de2e26c294282-EWR + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 16:47:53 GMT + Server: + - cloudflare + cf-cache-status: + - DYNAMIC + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - 849d5c93-e698-4c0b-acb6-d847342857db + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountName": + "u$ern@me", "password": "p@$$w0rd"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '116' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://shareous1.dexcom.com/ShareWebServices/Services/General/AuthenticatePublisherAccount + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-RAY: + - 950531265b3dc3fa-EWR + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Date: + - Sun, 15 Jun 2025 21:34:31 GMT + Server: + - cloudflare + cf-cache-status: + - DYNAMIC + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - 93ce59d7-f46b-428c-ab56-c71bd5b90980 + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +version: 1 diff --git a/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[ous-u$ern@me-None-password]/test_dexcom[ous-u$ern@me-None-password].yaml b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[ous-u$ern@me-None-password]/test_dexcom[ous-u$ern@me-None-password].yaml new file mode 100644 index 0000000..a7a5f8d --- /dev/null +++ b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[ous-u$ern@me-None-password]/test_dexcom[ous-u$ern@me-None-password].yaml @@ -0,0 +1,132 @@ +interactions: +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountName": + "u$ern@me", "password": "password"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '109' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://shareous1.dexcom.com/ShareWebServices/Services/General/AuthenticatePublisherAccount + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 932de2de191a32c5-PHL + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 16:47:52 GMT + Server: + - cloudflare + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - dc2e295f-19da-443b-b228-2dc7f34de8fd + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountName": + "u$ern@me", "password": "password"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '109' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://shareous1.dexcom.com/ShareWebServices/Services/General/AuthenticatePublisherAccount + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-RAY: + - 950531222fb30f5b-EWR + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Date: + - Sun, 15 Jun 2025 21:34:31 GMT + Server: + - cloudflare + cf-cache-status: + - DYNAMIC + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - 639b3f91-bcc8-4023-b4a9-e5e4fde7e5ce + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +version: 1 diff --git a/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[ous-username-None-p@$$w0rd]/test_dexcom[ous-username-None-p@$$w0rd].yaml b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[ous-username-None-p@$$w0rd]/test_dexcom[ous-username-None-p@$$w0rd].yaml new file mode 100644 index 0000000..bd30a08 --- /dev/null +++ b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[ous-username-None-p@$$w0rd]/test_dexcom[ous-username-None-p@$$w0rd].yaml @@ -0,0 +1,132 @@ +interactions: +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountName": + "username", "password": "p@$$w0rd"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '115' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://shareous1.dexcom.com/ShareWebServices/Services/General/AuthenticatePublisherAccount + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 932de2d96b3e6991-PHL + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 16:47:51 GMT + Server: + - cloudflare + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - ac326d54-a91b-4810-8f2d-c4801790adce + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountName": + "username", "password": "p@$$w0rd"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '115' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://shareous1.dexcom.com/ShareWebServices/Services/General/AuthenticatePublisherAccount + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-RAY: + - 9505311e3dc90f6f-EWR + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Date: + - Sun, 15 Jun 2025 21:34:30 GMT + Server: + - cloudflare + cf-cache-status: + - DYNAMIC + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - 4fa6b61c-b024-455b-a85f-f3220e595cca + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +version: 1 diff --git a/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[ous-username-None-password]/test_dexcom[ous-username-None-password].yaml b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[ous-username-None-password]/test_dexcom[ous-username-None-password].yaml new file mode 100644 index 0000000..ff47c14 --- /dev/null +++ b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[ous-username-None-password]/test_dexcom[ous-username-None-password].yaml @@ -0,0 +1,132 @@ +interactions: +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountName": + "username", "password": "password"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '108' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://shareous1.dexcom.com/ShareWebServices/Services/General/AuthenticatePublisherAccount + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-RAY: + - 932de2d569494268-EWR + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 16:47:51 GMT + Server: + - cloudflare + cf-cache-status: + - DYNAMIC + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - 4d37e213-99eb-4a98-b367-53e135e171bc + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountName": + "username", "password": "password"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '108' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://shareous1.dexcom.com/ShareWebServices/Services/General/AuthenticatePublisherAccount + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-RAY: + - 9505311a1b9ff78d-EWR + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Date: + - Sun, 15 Jun 2025 21:34:30 GMT + Server: + - cloudflare + cf-cache-status: + - DYNAMIC + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - c29c5f58-4517-48c6-bd6c-1845bd99da0d + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +version: 1 diff --git a/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[us-None-77777777-7777-7777-7777-777777777777-p@$$w0rd]/test_dexcom[us-None-77777777-7777-7777-7777-777777777777-p@$$w0rd].yaml b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[us-None-77777777-7777-7777-7777-777777777777-p@$$w0rd]/test_dexcom[us-None-77777777-7777-7777-7777-777777777777-p@$$w0rd].yaml new file mode 100644 index 0000000..f55e4ac --- /dev/null +++ b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[us-None-77777777-7777-7777-7777-777777777777-p@$$w0rd]/test_dexcom[us-None-77777777-7777-7777-7777-777777777777-p@$$w0rd].yaml @@ -0,0 +1,135 @@ +interactions: +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": + "77777777-7777-7777-7777-777777777777", "password": "p@$$w0rd"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '141' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 932de2e84ebb32c8-PHL + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 16:47:53 GMT + Server: + - cloudflare + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - 7d0438a7-31d4-4f27-a6ff-60b7b47b84e0 + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": + "77777777-7777-7777-7777-777777777777", "password": "p@$$w0rd"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '141' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-RAY: + - 9505312ca8410cc4-EWR + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Date: + - Sun, 15 Jun 2025 21:34:32 GMT + Server: + - cloudflare + Set-Cookie: + - _cfuvid=7Sb8OJ.uDYNIGLanovaHxcLLjlKSOWTIYgHhNGA7rHs-1750023272621-0.0.1.1-604800000; + path=/; domain=.share2.dexcom.com; HttpOnly; Secure; SameSite=None + cf-cache-status: + - DYNAMIC + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - 65c17695-d7b9-44b6-a036-cc1337f22a34 + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +version: 1 diff --git a/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[us-None-77777777-7777-7777-7777-777777777777-password]/test_dexcom[us-None-77777777-7777-7777-7777-777777777777-password].yaml b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[us-None-77777777-7777-7777-7777-777777777777-password]/test_dexcom[us-None-77777777-7777-7777-7777-777777777777-password].yaml new file mode 100644 index 0000000..5bd073a --- /dev/null +++ b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[us-None-77777777-7777-7777-7777-777777777777-password]/test_dexcom[us-None-77777777-7777-7777-7777-777777777777-password].yaml @@ -0,0 +1,135 @@ +interactions: +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": + "77777777-7777-7777-7777-777777777777", "password": "password"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '134' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-RAY: + - 932de2e67f6642df-EWR + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 16:47:53 GMT + Server: + - cloudflare + cf-cache-status: + - DYNAMIC + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - ba829c02-51d5-4b6d-adc4-71f482797573 + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": + "77777777-7777-7777-7777-777777777777", "password": "password"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '134' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-RAY: + - 9505312aa92218bc-EWR + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Date: + - Sun, 15 Jun 2025 21:34:32 GMT + Server: + - cloudflare + Set-Cookie: + - _cfuvid=QqM_dZ56qiNDmyl_N4d.byCeCXBWlB17q8g291ULihw-1750023272326-0.0.1.1-604800000; + path=/; domain=.share2.dexcom.com; HttpOnly; Secure; SameSite=None + cf-cache-status: + - DYNAMIC + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - 09d8f826-3f03-409f-847e-3c4d008a9906 + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +version: 1 diff --git a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None-99999999-9999-9999-9999-999999999999-p@$$w0rd].yaml b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[us-None-99999999-9999-9999-9999-999999999999-p@$$w0rd]/test_dexcom[us-None-99999999-9999-9999-9999-999999999999-p@$$w0rd].yaml similarity index 69% rename from tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None-99999999-9999-9999-9999-999999999999-p@$$w0rd].yaml rename to tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[us-None-99999999-9999-9999-9999-999999999999-p@$$w0rd]/test_dexcom[us-None-99999999-9999-9999-9999-999999999999-p@$$w0rd].yaml index c148eb2..5d9b0c2 100644 --- a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[None-99999999-9999-9999-9999-999999999999-p@$$w0rd].yaml +++ b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[us-None-99999999-9999-9999-9999-999999999999-p@$$w0rd]/test_dexcom[us-None-99999999-9999-9999-9999-999999999999-p@$$w0rd].yaml @@ -14,17 +14,15 @@ interactions: Content-Type: - application/json User-Agent: - - python-requests/2.31.0 + - python-requests/2.32.3 method: POST uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById response: body: string: '"55555555-5555-5555-5555-555555555555"' headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a673fe6399332cc-PHL + CF-RAY: + - 932de2ed3e7841b2-EWR Cache-Control: - no-cache, no-store, max-age=0, must-revalidate Connection: @@ -34,24 +32,27 @@ interactions: Content-Type: - application/json Date: - - Sun, 21 Jul 2024 00:59:40 GMT - Expires: - - '0' + - Sat, 19 Apr 2025 16:47:54 GMT Server: - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Origin, - Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding + cf-cache-status: + - DYNAMIC + expires: + - '0' pragma: - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers x-content-type-options: - nosniff x-frame-options: - DENY x-trace-id: - - 4c044dbd-ef07-470b-b2a6-dd30e8b5005a + - 02896385-0db4-4b42-8c07-0e862eca93a8 x-xss-protection: - '0' status: @@ -72,17 +73,15 @@ interactions: Content-Type: - application/json User-Agent: - - python-requests/2.31.0 + - python-requests/2.32.3 method: POST uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById response: body: string: '"55555555-5555-5555-5555-555555555555"' headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a67bac868884cae-PHL + CF-RAY: + - 950531313fe80f75-EWR Cache-Control: - no-cache, no-store, max-age=0, must-revalidate Connection: @@ -92,24 +91,30 @@ interactions: Content-Type: - application/json Date: - - Sun, 21 Jul 2024 02:23:33 GMT - Expires: - - '0' + - Sun, 15 Jun 2025 21:34:33 GMT Server: - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Origin, - Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding + Set-Cookie: + - _cfuvid=ys4v1m6xT6pHgq4CM33C0Jep8A61wHW4VL.aSIOOgkg-1750023273454-0.0.1.1-604800000; + path=/; domain=.share2.dexcom.com; HttpOnly; Secure; SameSite=None + cf-cache-status: + - DYNAMIC + expires: + - '0' pragma: - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers x-content-type-options: - nosniff x-frame-options: - DENY x-trace-id: - - 1b736caa-d135-4dfe-a6ce-b8c13618627b + - 70758d14-de05-4f52-bf88-56de3c6d4af9 x-xss-protection: - '0' status: diff --git a/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[us-None-99999999-9999-9999-9999-999999999999-password]/test_dexcom[us-None-99999999-9999-9999-9999-999999999999-password].yaml b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[us-None-99999999-9999-9999-9999-999999999999-password]/test_dexcom[us-None-99999999-9999-9999-9999-999999999999-password].yaml new file mode 100644 index 0000000..fb67e9d --- /dev/null +++ b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[us-None-99999999-9999-9999-9999-999999999999-password]/test_dexcom[us-None-99999999-9999-9999-9999-999999999999-password].yaml @@ -0,0 +1,135 @@ +interactions: +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": + "99999999-9999-9999-9999-999999999999", "password": "password"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '134' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 932de2ea385c32c5-PHL + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 16:47:54 GMT + Server: + - cloudflare + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - 22044f6f-9e75-408d-a1a8-812bbcfe3d28 + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": + "99999999-9999-9999-9999-999999999999", "password": "password"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '134' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-RAY: + - 9505312e998d186d-EWR + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Date: + - Sun, 15 Jun 2025 21:34:33 GMT + Server: + - cloudflare + Set-Cookie: + - _cfuvid=s5odsncDnrlxjeE3M2ecT0xki0xe7jU7qi3xJDCGY08-1750023273013-0.0.1.1-604800000; + path=/; domain=.share2.dexcom.com; HttpOnly; Secure; SameSite=None + cf-cache-status: + - DYNAMIC + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - 3ad96bc0-ec6b-4204-8a55-b7c139498293 + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +version: 1 diff --git a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[u$ern@me-None-p@$$w0rd].yaml b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[us-u$ern@me-None-p@$$w0rd]/test_dexcom[us-u$ern@me-None-p@$$w0rd].yaml similarity index 70% rename from tests/cassettes/test_dexcom/TestDexcom/test_dexcom[u$ern@me-None-p@$$w0rd].yaml rename to tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[us-u$ern@me-None-p@$$w0rd]/test_dexcom[us-u$ern@me-None-p@$$w0rd].yaml index 02e5655..676951d 100644 --- a/tests/cassettes/test_dexcom/TestDexcom/test_dexcom[u$ern@me-None-p@$$w0rd].yaml +++ b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[us-u$ern@me-None-p@$$w0rd]/test_dexcom[us-u$ern@me-None-p@$$w0rd].yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json User-Agent: - - python-requests/2.31.0 + - python-requests/2.32.3 method: POST uri: https://share2.dexcom.com/ShareWebServices/Services/General/AuthenticatePublisherAccount response: @@ -23,8 +23,8 @@ interactions: headers: CF-Cache-Status: - DYNAMIC - CF-Ray: - - 8a673ff8be0832c8-PHL + CF-RAY: + - 9318541eef6b32b2-PHL Cache-Control: - no-cache, no-store, max-age=0, must-revalidate Connection: @@ -34,24 +34,25 @@ interactions: Content-Type: - application/json Date: - - Sun, 21 Jul 2024 00:59:43 GMT - Expires: - - '0' + - Thu, 17 Apr 2025 02:00:24 GMT Server: - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Origin, - Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding + expires: + - '0' pragma: - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers x-content-type-options: - nosniff x-frame-options: - DENY x-trace-id: - - f2b273e2-3190-4279-866f-5637ee447712 + - 7cc17940-915e-463b-ae20-5f9daa30a263 x-xss-protection: - '0' status: @@ -72,17 +73,15 @@ interactions: Content-Type: - application/json User-Agent: - - python-requests/2.31.0 + - python-requests/2.32.3 method: POST uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById response: body: string: '"55555555-5555-5555-5555-555555555555"' headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a673ffe4a2e32c6-PHL + CF-RAY: + - 931854242e0e41d5-EWR Cache-Control: - no-cache, no-store, max-age=0, must-revalidate Connection: @@ -92,24 +91,27 @@ interactions: Content-Type: - application/json Date: - - Sun, 21 Jul 2024 00:59:44 GMT - Expires: - - '0' + - Thu, 17 Apr 2025 02:00:25 GMT Server: - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Origin, - Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding + cf-cache-status: + - DYNAMIC + expires: + - '0' pragma: - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers x-content-type-options: - nosniff x-frame-options: - DENY x-trace-id: - - 5ab239db-2bc9-41be-a081-836750a353b2 + - 2fc44a06-544f-4416-ab13-e488dfa8b75f x-xss-protection: - '0' status: @@ -130,17 +132,15 @@ interactions: Content-Type: - application/json User-Agent: - - python-requests/2.31.0 + - python-requests/2.32.3 method: POST uri: https://share2.dexcom.com/ShareWebServices/Services/General/AuthenticatePublisherAccount response: body: string: '"99999999-9999-9999-9999-999999999999"' headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a67bad85bc432c8-PHL + CF-RAY: + - 9505313aeb020f83-EWR Cache-Control: - no-cache, no-store, max-age=0, must-revalidate Connection: @@ -150,24 +150,30 @@ interactions: Content-Type: - application/json Date: - - Sun, 21 Jul 2024 02:23:36 GMT - Expires: - - '0' + - Sun, 15 Jun 2025 21:34:34 GMT Server: - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Origin, - Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding + Set-Cookie: + - _cfuvid=hkDseCLQZ31.tYzq0_HhYMYTa9acui7OaiiUTL.V408-1750023274996-0.0.1.1-604800000; + path=/; domain=.share2.dexcom.com; HttpOnly; Secure; SameSite=None + cf-cache-status: + - DYNAMIC + expires: + - '0' pragma: - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers x-content-type-options: - nosniff x-frame-options: - DENY x-trace-id: - - a8c5d213-5c1f-4217-9305-99509a27b5f3 + - d8b9f8a8-3700-4e76-a045-920bc3dbaaed x-xss-protection: - '0' status: @@ -187,18 +193,18 @@ interactions: - '141' Content-Type: - application/json + Cookie: + - _cfuvid=hkDseCLQZ31.tYzq0_HhYMYTa9acui7OaiiUTL.V408-1750023274996-0.0.1.1-604800000 User-Agent: - - python-requests/2.31.0 + - python-requests/2.32.3 method: POST uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById response: body: string: '"55555555-5555-5555-5555-555555555555"' headers: - CF-Cache-Status: - - DYNAMIC - CF-Ray: - - 8a67badce9ff4cb6-PHL + CF-RAY: + - 9505313deafdc3fa-EWR Cache-Control: - no-cache, no-store, max-age=0, must-revalidate Connection: @@ -208,24 +214,27 @@ interactions: Content-Type: - application/json Date: - - Sun, 21 Jul 2024 02:23:37 GMT - Expires: - - '0' + - Sun, 15 Jun 2025 21:34:35 GMT Server: - cloudflare - Strict-Transport-Security: - - max-age=0 - Vary: - - Origin, Access-Control-Request-Method, Access-Control-Request-Headers, Origin, - Access-Control-Request-Method, Access-Control-Request-Headers, Accept-Encoding + cf-cache-status: + - DYNAMIC + expires: + - '0' pragma: - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers x-content-type-options: - nosniff x-frame-options: - DENY x-trace-id: - - 1437225d-5c3b-4e28-aa40-79bfd3a77098 + - 65e9921f-43cf-4866-8004-c7d7a88207ee x-xss-protection: - '0' status: diff --git a/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[us-u$ern@me-None-password]/test_dexcom[us-u$ern@me-None-password].yaml b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[us-u$ern@me-None-password]/test_dexcom[us-u$ern@me-None-password].yaml new file mode 100644 index 0000000..d8c2b77 --- /dev/null +++ b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[us-u$ern@me-None-password]/test_dexcom[us-u$ern@me-None-password].yaml @@ -0,0 +1,135 @@ +interactions: +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountName": + "u$ern@me", "password": "password"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '109' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/General/AuthenticatePublisherAccount + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-RAY: + - 932de2f50c244265-EWR + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 16:47:55 GMT + Server: + - cloudflare + cf-cache-status: + - DYNAMIC + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - f7b69b56-d2e9-4f7b-a9e4-bcb575927e74 + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountName": + "u$ern@me", "password": "password"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '109' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/General/AuthenticatePublisherAccount + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-RAY: + - 95053138bb7432c5-PHL + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Date: + - Sun, 15 Jun 2025 21:34:34 GMT + Server: + - cloudflare + Set-Cookie: + - _cfuvid=UlnX0rA3hQkhh4RJAy7a7usf6Ujx4fEUL3okjPlyoO4-1750023274573-0.0.1.1-604800000; + path=/; domain=.share2.dexcom.com; HttpOnly; Secure; SameSite=None + cf-cache-status: + - DYNAMIC + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - ffff2a4a-529b-4c95-bd55-6f8971fee21e + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +version: 1 diff --git a/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[us-username-None-p@$$w0rd]/test_dexcom[us-username-None-p@$$w0rd].yaml b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[us-username-None-p@$$w0rd]/test_dexcom[us-username-None-p@$$w0rd].yaml new file mode 100644 index 0000000..e9b3838 --- /dev/null +++ b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[us-username-None-p@$$w0rd]/test_dexcom[us-username-None-p@$$w0rd].yaml @@ -0,0 +1,135 @@ +interactions: +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountName": + "username", "password": "p@$$w0rd"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '115' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/General/AuthenticatePublisherAccount + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 932de2f2df354cb1-PHL + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 16:47:55 GMT + Server: + - cloudflare + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - cee3aa55-83e3-4fb3-8051-846c650c3d5e + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountName": + "username", "password": "p@$$w0rd"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '115' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/General/AuthenticatePublisherAccount + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-RAY: + - 950531367b92c407-EWR + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Date: + - Sun, 15 Jun 2025 21:34:34 GMT + Server: + - cloudflare + Set-Cookie: + - _cfuvid=_s9hWQaO6ADHy6bfYgRmCKYfv9WcYExbvqBW6IhGAqE-1750023274233-0.0.1.1-604800000; + path=/; domain=.share2.dexcom.com; HttpOnly; Secure; SameSite=None + cf-cache-status: + - DYNAMIC + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - 52612fad-411a-48a1-b4a2-d260ae95d954 + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +version: 1 diff --git a/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[us-username-None-password]/test_dexcom[us-username-None-password].yaml b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[us-username-None-password]/test_dexcom[us-username-None-password].yaml new file mode 100644 index 0000000..2cb9a99 --- /dev/null +++ b/tests/cassettes/tests/test_dexcom/TestDexcom/test_dexcom[us-username-None-password]/test_dexcom[us-username-None-password].yaml @@ -0,0 +1,135 @@ +interactions: +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountName": + "username", "password": "password"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '108' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/General/AuthenticatePublisherAccount + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 932de2f0d9234cac-PHL + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 16:47:55 GMT + Server: + - cloudflare + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - a2c46027-ffc5-4163-82fb-943613558a70 + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountName": + "username", "password": "password"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '108' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/General/AuthenticatePublisherAccount + response: + body: + string: '{"Code":"AccountPasswordInvalid","Message":"Publisher account password + failed","SubCode":"","TypeName":"FaultException"}' + headers: + CF-RAY: + - 95053134bbccc457-EWR + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Date: + - Sun, 15 Jun 2025 21:34:33 GMT + Server: + - cloudflare + Set-Cookie: + - _cfuvid=0bjFl3K69UMWSi5aZQEw6sBrGqvcJzE3qzAM0cgla4U-1750023273907-0.0.1.1-604800000; + path=/; domain=.share2.dexcom.com; HttpOnly; Secure; SameSite=None + cf-cache-status: + - DYNAMIC + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - a651b591-f77b-437e-ac44-82ddc89ad996 + x-xss-protection: + - '0' + status: + code: 500 + message: Internal Server Error +version: 1 diff --git a/tests/cassettes/tests/test_glucose_reading/TestGlucoseReading/dexcom.yaml b/tests/cassettes/tests/test_glucose_reading/TestGlucoseReading/dexcom.yaml new file mode 100644 index 0000000..0fce1e3 --- /dev/null +++ b/tests/cassettes/tests/test_glucose_reading/TestGlucoseReading/dexcom.yaml @@ -0,0 +1,182 @@ +interactions: +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": + "99999999-9999-9999-9999-999999999999", "password": "p@$$w0rd"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '141' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById + response: + body: + string: '"55555555-5555-5555-5555-555555555555"' + headers: + CF-RAY: + - 932de03b8ccf41ac-EWR + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '38' + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 16:46:04 GMT + Server: + - cloudflare + cf-cache-status: + - DYNAMIC + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - ddc6e01a-d10a-43f5-92f9-106e88ecbfa9 + x-xss-protection: + - '0' + status: + code: 200 + message: OK +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": + "99999999-9999-9999-9999-999999999999", "password": "p@$$w0rd"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '141' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById + response: + body: + string: '"55555555-5555-5555-5555-555555555555"' + headers: + CF-RAY: + - 932df55c4b6f42ec-EWR + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '38' + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 17:00:29 GMT + Server: + - cloudflare + cf-cache-status: + - DYNAMIC + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - 9c7b8449-c712-47b5-a94a-30622b21f505 + x-xss-protection: + - '0' + status: + code: 200 + message: OK +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": + "99999999-9999-9999-9999-999999999999", "password": "p@$$w0rd"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '141' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById + response: + body: + string: '"55555555-5555-5555-5555-555555555555"' + headers: + CF-RAY: + - 950531418f61185d-EWR + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '38' + Content-Type: + - application/json + Date: + - Sun, 15 Jun 2025 21:34:36 GMT + Server: + - cloudflare + Set-Cookie: + - _cfuvid=KORRTCDGxX3tRuupxAKH3wgnDzJYW7dr6zoPlD6waH0-1750023276110-0.0.1.1-604800000; + path=/; domain=.share2.dexcom.com; HttpOnly; Secure; SameSite=None + cf-cache-status: + - DYNAMIC + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - 02327dda-a0f6-4740-b6ff-e1c115091dda + x-xss-protection: + - '0' + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/tests/test_glucose_reading/TestGlucoseReading/test_get_current_glucose_reading/test_get_current_glucose_reading.yaml b/tests/cassettes/tests/test_glucose_reading/TestGlucoseReading/test_get_current_glucose_reading/test_get_current_glucose_reading.yaml new file mode 100644 index 0000000..217a2ef --- /dev/null +++ b/tests/cassettes/tests/test_glucose_reading/TestGlucoseReading/test_get_current_glucose_reading/test_get_current_glucose_reading.yaml @@ -0,0 +1,148 @@ +interactions: +- request: + body: '{}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 + response: + body: + string: '[{"WT":"Date(1745081013817)","ST":"Date(1745081013817)","DT":"Date(1745081013817-0400)","Value":224,"Trend":"Flat"}]' + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 932de046cf7e4cb6-PHL + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 16:46:05 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-trace-id: + - 05958b16-3cb1-444e-b3ea-6ab2b450b437 + status: + code: 200 + message: OK +- request: + body: '{}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 + response: + body: + string: '[{"WT":"Date(1745081913085)","ST":"Date(1745081913085)","DT":"Date(1745081913085-0400)","Value":216,"Trend":"Flat"}]' + headers: + CF-RAY: + - 932df5653f5f4216-EWR + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 17:00:30 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + cf-cache-status: + - DYNAMIC + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-trace-id: + - 7db00d7d-b09f-4b4b-a61c-07ae45bacf36 + status: + code: 200 + message: OK +- request: + body: '{}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + Cookie: + - _cfuvid=KORRTCDGxX3tRuupxAKH3wgnDzJYW7dr6zoPlD6waH0-1750023276110-0.0.1.1-604800000 + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 + response: + body: + string: '[{"WT":"Date(1750022969925)","ST":"Date(1750022969925)","DT":"Date(1750022969925-0400)","Value":175,"Trend":"Flat"}]' + headers: + CF-RAY: + - 95053149b9d4f797-EWR + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Sun, 15 Jun 2025 21:34:37 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + cf-cache-status: + - DYNAMIC + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-trace-id: + - 08740cdf-bef1-4013-8f09-d3c2a57e6424 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/tests/test_glucose_reading/TestGlucoseReading/test_get_current_glucose_reading_session_expired/test_get_current_glucose_reading_session_expired.yaml b/tests/cassettes/tests/test_glucose_reading/TestGlucoseReading/test_get_current_glucose_reading_session_expired/test_get_current_glucose_reading_session_expired.yaml new file mode 100644 index 0000000..e8598d3 --- /dev/null +++ b/tests/cassettes/tests/test_glucose_reading/TestGlucoseReading/test_get_current_glucose_reading_session_expired/test_get_current_glucose_reading_session_expired.yaml @@ -0,0 +1,497 @@ +interactions: +- request: + body: '{}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10 + response: + body: + string: '{"Code":"SessionIdNotFound","Message":"Failed to find session object. + [SessionId = 33333333-3333-3333-3333-333333333333]","SubCode":"","TypeName":"FaultException"}' + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 932de047af6632c8-PHL + Connection: + - keep-alive + Content-Length: + - '750' + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 16:46:06 GMT + Server: + - cloudflare + X-Content-Type-Options: + - nosniff + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-trace-id: + - 68ab35ad-5529-4928-b40c-9fc909f70c3f + status: + code: 500 + message: Internal Server Error +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": + "99999999-9999-9999-9999-999999999999", "password": "p@$$w0rd"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '141' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById + response: + body: + string: '"55555555-5555-5555-5555-555555555555"' + headers: + CF-RAY: + - 932de0489dc441b4-EWR + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '38' + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 16:46:06 GMT + Server: + - cloudflare + cf-cache-status: + - DYNAMIC + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - e22f780e-bbfa-4a12-8bec-14d056952580 + x-xss-protection: + - '0' + status: + code: 200 + message: OK +- request: + body: '{}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 + response: + body: + string: '[{"WT":"Date(1745081013817)","ST":"Date(1745081013817)","DT":"Date(1745081013817-0400)","Value":224,"Trend":"Flat"}]' + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 932de04bcb4732b2-PHL + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 16:46:06 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-trace-id: + - 7214b599-0268-4d89-9455-cfd948edcda7 + status: + code: 200 + message: OK +- request: + body: '{}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10 + response: + body: + string: '{"Code":"SessionIdNotFound","Message":"Failed to find session object. + [SessionId = 33333333-3333-3333-3333-333333333333]","SubCode":"","TypeName":"FaultException"}' + headers: + CF-RAY: + - 932df5664f2e5e76-EWR + Connection: + - keep-alive + Content-Length: + - '750' + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 17:00:31 GMT + Server: + - cloudflare + X-Content-Type-Options: + - nosniff + cf-cache-status: + - DYNAMIC + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-trace-id: + - c164319d-35f1-4e75-83b8-a31861dcda42 + status: + code: 500 + message: Internal Server Error +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": + "99999999-9999-9999-9999-999999999999", "password": "p@$$w0rd"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '141' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById + response: + body: + string: '"55555555-5555-5555-5555-555555555555"' + headers: + CF-RAY: + - 932df567481f42ef-EWR + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '38' + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 17:00:31 GMT + Server: + - cloudflare + cf-cache-status: + - DYNAMIC + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - 078f51ec-e6ab-4a4d-b47d-0ef43871bb7d + x-xss-protection: + - '0' + status: + code: 200 + message: OK +- request: + body: '{}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 + response: + body: + string: '[{"WT":"Date(1745081913085)","ST":"Date(1745081913085)","DT":"Date(1745081913085-0400)","Value":216,"Trend":"Flat"}]' + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 932df56adb7032c8-PHL + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 17:00:31 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-trace-id: + - 7d20ce35-20e1-43bc-8426-e42b47b48670 + status: + code: 200 + message: OK +- request: + body: '{}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + Cookie: + - _cfuvid=KORRTCDGxX3tRuupxAKH3wgnDzJYW7dr6zoPlD6waH0-1750023276110-0.0.1.1-604800000 + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10 + response: + body: + string: '{"Code":"SessionIdNotFound","Message":"Failed to find session object. + [SessionId = 33333333-3333-3333-3333-333333333333]","SubCode":"","TypeName":"FaultException"}' + headers: + CF-RAY: + - 9505314ab8290f39-EWR + Connection: + - keep-alive + Content-Length: + - '750' + Content-Type: + - application/json + Date: + - Sun, 15 Jun 2025 21:34:37 GMT + Server: + - cloudflare + X-Content-Type-Options: + - nosniff + cf-cache-status: + - DYNAMIC + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-trace-id: + - b65401ed-12c3-4f78-aedb-c9f73301901b + status: + code: 500 + message: Internal Server Error +- request: + body: '{"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db", "accountId": + "99999999-9999-9999-9999-999999999999", "password": "p@$$w0rd"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '141' + Content-Type: + - application/json + Cookie: + - _cfuvid=KORRTCDGxX3tRuupxAKH3wgnDzJYW7dr6zoPlD6waH0-1750023276110-0.0.1.1-604800000 + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountById + response: + body: + string: '"55555555-5555-5555-5555-555555555555"' + headers: + CF-RAY: + - 9505314b9cfdde93-EWR + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Connection: + - keep-alive + Content-Length: + - '38' + Content-Type: + - application/json + Date: + - Sun, 15 Jun 2025 21:34:37 GMT + Server: + - cloudflare + cf-cache-status: + - DYNAMIC + expires: + - '0' + pragma: + - no-cache + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-content-type-options: + - nosniff + x-frame-options: + - DENY + x-trace-id: + - b2cf9079-383f-44d0-bd0c-afa536f7f876 + x-xss-protection: + - '0' + status: + code: 200 + message: OK +- request: + body: '{}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + Cookie: + - _cfuvid=KORRTCDGxX3tRuupxAKH3wgnDzJYW7dr6zoPlD6waH0-1750023276110-0.0.1.1-604800000 + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 + response: + body: + string: '[{"WT":"Date(1750022969925)","ST":"Date(1750022969925)","DT":"Date(1750022969925-0400)","Value":175,"Trend":"Flat"}]' + headers: + CF-RAY: + - 9505314ebc150f87-EWR + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Sun, 15 Jun 2025 21:34:37 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + cf-cache-status: + - DYNAMIC + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-trace-id: + - 9c90e3c4-ea44-4d76-ba58-679e29e8fb94 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/tests/test_glucose_reading/TestGlucoseReading/test_get_glucose_readings[0-0]/test_get_glucose_readings[0-0].yaml b/tests/cassettes/tests/test_glucose_reading/TestGlucoseReading/test_get_glucose_readings[0-0]/test_get_glucose_readings[0-0].yaml new file mode 100644 index 0000000..99b55c1 --- /dev/null +++ b/tests/cassettes/tests/test_glucose_reading/TestGlucoseReading/test_get_glucose_readings[0-0]/test_get_glucose_readings[0-0].yaml @@ -0,0 +1,148 @@ +interactions: +- request: + body: '{}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=0&minutes=0&sessionId=55555555-5555-5555-5555-555555555555 + response: + body: + string: '[]' + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 932de03f6ef332c5-PHL + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 16:46:04 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-trace-id: + - 509f2fc3-c31e-4ca9-a5d8-31ba42630590 + status: + code: 200 + message: OK +- request: + body: '{}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=0&minutes=0&sessionId=55555555-5555-5555-5555-555555555555 + response: + body: + string: '[]' + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 932df55fbf444cac-PHL + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 17:00:30 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-trace-id: + - 58bfe752-7b25-4973-b903-3037e9e7294b + status: + code: 200 + message: OK +- request: + body: '{}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + Cookie: + - _cfuvid=KORRTCDGxX3tRuupxAKH3wgnDzJYW7dr6zoPlD6waH0-1750023276110-0.0.1.1-604800000 + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=0&minutes=0&sessionId=55555555-5555-5555-5555-555555555555 + response: + body: + string: '[]' + headers: + CF-RAY: + - 950531449b2e0f9b-EWR + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Sun, 15 Jun 2025 21:34:36 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + cf-cache-status: + - DYNAMIC + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-trace-id: + - c3f539bc-1a54-4e47-82d0-d059cd83ff6f + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/tests/test_glucose_reading/TestGlucoseReading/test_get_glucose_readings[0-10]/test_get_glucose_readings[0-10].yaml b/tests/cassettes/tests/test_glucose_reading/TestGlucoseReading/test_get_glucose_readings[0-10]/test_get_glucose_readings[0-10].yaml new file mode 100644 index 0000000..cfc049d --- /dev/null +++ b/tests/cassettes/tests/test_glucose_reading/TestGlucoseReading/test_get_glucose_readings[0-10]/test_get_glucose_readings[0-10].yaml @@ -0,0 +1,148 @@ +interactions: +- request: + body: '{}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=0&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 + response: + body: + string: '[]' + headers: + CF-RAY: + - 932de04179cd42d8-EWR + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 16:46:05 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + cf-cache-status: + - DYNAMIC + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-trace-id: + - 15619deb-67d5-4567-a4c9-2037cd80c929 + status: + code: 200 + message: OK +- request: + body: '{}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=0&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 + response: + body: + string: '[]' + headers: + CF-RAY: + - 932df560d905422e-EWR + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 17:00:30 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + cf-cache-status: + - DYNAMIC + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-trace-id: + - c51e68bd-fd92-43c7-8f1d-aab5800c3f2d + status: + code: 200 + message: OK +- request: + body: '{}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + Cookie: + - _cfuvid=KORRTCDGxX3tRuupxAKH3wgnDzJYW7dr6zoPlD6waH0-1750023276110-0.0.1.1-604800000 + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=0&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 + response: + body: + string: '[]' + headers: + CF-RAY: + - 950531459886f797-EWR + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Sun, 15 Jun 2025 21:34:36 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + cf-cache-status: + - DYNAMIC + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-trace-id: + - d64bdf4f-be07-477c-90fa-e56ed4b3bc3a + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/tests/test_glucose_reading/TestGlucoseReading/test_get_glucose_readings[1-0]/test_get_glucose_readings[1-0].yaml b/tests/cassettes/tests/test_glucose_reading/TestGlucoseReading/test_get_glucose_readings[1-0]/test_get_glucose_readings[1-0].yaml new file mode 100644 index 0000000..31d1986 --- /dev/null +++ b/tests/cassettes/tests/test_glucose_reading/TestGlucoseReading/test_get_glucose_readings[1-0]/test_get_glucose_readings[1-0].yaml @@ -0,0 +1,148 @@ +interactions: +- request: + body: '{}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=0&sessionId=55555555-5555-5555-5555-555555555555 + response: + body: + string: '[]' + headers: + CF-RAY: + - 932de042cce142d2-EWR + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 16:46:05 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + cf-cache-status: + - DYNAMIC + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-trace-id: + - 39e00e7d-a715-4f71-abe9-20b35961bc6f + status: + code: 200 + message: OK +- request: + body: '{}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=0&sessionId=55555555-5555-5555-5555-555555555555 + response: + body: + string: '[]' + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 932df561ffb032c8-PHL + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 17:00:30 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-trace-id: + - 913ab905-8a27-44dd-b815-23bc6ac3777d + status: + code: 200 + message: OK +- request: + body: '{}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + Cookie: + - _cfuvid=KORRTCDGxX3tRuupxAKH3wgnDzJYW7dr6zoPlD6waH0-1750023276110-0.0.1.1-604800000 + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=0&sessionId=55555555-5555-5555-5555-555555555555 + response: + body: + string: '[]' + headers: + CF-RAY: + - 95053146cc7dde97-EWR + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Sun, 15 Jun 2025 21:34:36 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + cf-cache-status: + - DYNAMIC + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-trace-id: + - 547ff6a4-29ca-46df-9df0-a0d1d6b53f63 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/tests/test_glucose_reading/TestGlucoseReading/test_get_glucose_readings[1-10]/test_get_glucose_readings[1-10].yaml b/tests/cassettes/tests/test_glucose_reading/TestGlucoseReading/test_get_glucose_readings[1-10]/test_get_glucose_readings[1-10].yaml new file mode 100644 index 0000000..b78082c --- /dev/null +++ b/tests/cassettes/tests/test_glucose_reading/TestGlucoseReading/test_get_glucose_readings[1-10]/test_get_glucose_readings[1-10].yaml @@ -0,0 +1,148 @@ +interactions: +- request: + body: '{}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 + response: + body: + string: '[{"WT":"Date(1745081013817)","ST":"Date(1745081013817)","DT":"Date(1745081013817-0400)","Value":224,"Trend":"Flat"}]' + headers: + CF-RAY: + - 932de043ed8141cf-EWR + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 16:46:05 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + cf-cache-status: + - DYNAMIC + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-trace-id: + - 350254e5-85b9-46f7-83c7-591368ec6631 + status: + code: 200 + message: OK +- request: + body: '{}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 + response: + body: + string: '[{"WT":"Date(1745081913085)","ST":"Date(1745081913085)","DT":"Date(1745081913085-0400)","Value":216,"Trend":"Flat"}]' + headers: + CF-RAY: + - 932df5630dbc425f-EWR + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 17:00:30 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + cf-cache-status: + - DYNAMIC + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-trace-id: + - 08351662-86c4-4a73-9ecc-5e7f7b8c9f68 + status: + code: 200 + message: OK +- request: + body: '{}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + Cookie: + - _cfuvid=KORRTCDGxX3tRuupxAKH3wgnDzJYW7dr6zoPlD6waH0-1750023276110-0.0.1.1-604800000 + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=10&sessionId=55555555-5555-5555-5555-555555555555 + response: + body: + string: '[{"WT":"Date(1750022969925)","ST":"Date(1750022969925)","DT":"Date(1750022969925-0400)","Value":175,"Trend":"Flat"}]' + headers: + CF-RAY: + - 95053147dfbd0f81-EWR + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Sun, 15 Jun 2025 21:34:36 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + cf-cache-status: + - DYNAMIC + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-trace-id: + - 3f6e1733-e558-4002-8a83-b51f5ce78619 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/tests/test_glucose_reading/TestGlucoseReading/test_get_latest_glucose_reading/test_get_latest_glucose_reading.yaml b/tests/cassettes/tests/test_glucose_reading/TestGlucoseReading/test_get_latest_glucose_reading/test_get_latest_glucose_reading.yaml new file mode 100644 index 0000000..df0b076 --- /dev/null +++ b/tests/cassettes/tests/test_glucose_reading/TestGlucoseReading/test_get_latest_glucose_reading/test_get_latest_glucose_reading.yaml @@ -0,0 +1,148 @@ +interactions: +- request: + body: '{}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=1440&sessionId=55555555-5555-5555-5555-555555555555 + response: + body: + string: '[{"WT":"Date(1745081013817)","ST":"Date(1745081013817)","DT":"Date(1745081013817-0400)","Value":224,"Trend":"Flat"}]' + headers: + CF-RAY: + - 932de045cad741b4-EWR + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 16:46:05 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + cf-cache-status: + - DYNAMIC + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-trace-id: + - fe175def-d93e-4f98-ac46-b99162e6589e + status: + code: 200 + message: OK +- request: + body: '{}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=1440&sessionId=55555555-5555-5555-5555-555555555555 + response: + body: + string: '[{"WT":"Date(1745081913085)","ST":"Date(1745081913085)","DT":"Date(1745081913085-0400)","Value":216,"Trend":"Flat"}]' + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 932df56409294cb6-PHL + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Sat, 19 Apr 2025 17:00:30 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-trace-id: + - 84350fcb-363e-4ec5-8cd8-5ee9284149f3 + status: + code: 200 + message: OK +- request: + body: '{}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - application/json + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + Cookie: + - _cfuvid=KORRTCDGxX3tRuupxAKH3wgnDzJYW7dr6zoPlD6waH0-1750023276110-0.0.1.1-604800000 + User-Agent: + - python-requests/2.32.3 + method: POST + uri: https://share2.dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues?maxCount=1&minutes=1440&sessionId=55555555-5555-5555-5555-555555555555 + response: + body: + string: '[{"WT":"Date(1750022969925)","ST":"Date(1750022969925)","DT":"Date(1750022969925-0400)","Value":175,"Trend":"Flat"}]' + headers: + CF-RAY: + - 95053148cff2de9b-EWR + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Sun, 15 Jun 2025 21:34:36 GMT + Server: + - cloudflare + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + cf-cache-status: + - DYNAMIC + strict-transport-security: + - max-age=15780000; includeSubDomains; preload + vary: + - Origin + - Access-Control-Request-Method + - Access-Control-Request-Headers + x-trace-id: + - eca1e7f9-1e45-471e-bec0-3e92b83c084d + status: + code: 200 + message: OK +version: 1 diff --git a/tests/conftest.py b/tests/conftest.py index 6aecd93..9f9063b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,144 +1,197 @@ +"""pytest configuration for pydexcom package tests.""" + +import logging import os import re +from collections.abc import Iterator from pathlib import Path -from typing import Any, Dict, Generator +from typing import Any, Union from uuid import UUID import pytest from vcr import VCR +from vcr.cassette import Cassette from vcr.record_mode import RecordMode +from vcr.request import Request -from pydexcom import DEFAULT_UUID, DEXCOM_APPLICATION_IDS +from pydexcom.const import DEFAULT_UUID, Region -r_UUID = r"[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" +LOGGER = logging.getLogger(__name__) TEST_USERNAME = "u$ern@me" -TEST_PASSWORD = "p@$$w0rd" +TEST_PASSWORD = "p@$$w0rd" # noqa: S105 TEST_ACCOUNT_ID = "99999999-9999-9999-9999-999999999999" TEST_SESSION_ID = "55555555-5555-5555-5555-555555555555" +TEST_SESSION_ID_EXPIRED = "33333333-3333-3333-3333-333333333333" USERNAME = os.environ.get("DEXCOM_USERNAME", TEST_USERNAME) PASSWORD = os.environ.get("DEXCOM_PASSWORD", TEST_PASSWORD) ACCOUNT_ID = os.environ.get("DEXCOM_ACCOUNT_ID", TEST_ACCOUNT_ID) -SESSION_ID = os.environ.get("DEXCOM_SESSION_ID", TEST_SESSION_ID) +REGION = os.environ.get("DEXCOM_REGION", Region.US) -TEST_SESSION_ID_EXPIRED = "33333333-3333-3333-3333-333333333333" + +def pytest_addoption(parser: pytest.Parser) -> None: + """Add VCR.py options to pytest.""" + group = parser.getgroup("vcr") + group.addoption( + "--record-mode", + action="store", + dest="vcr_record_mode", + default=RecordMode.NONE, + type=RecordMode, + choices=list(RecordMode), + help="Set the recording mode for VCR.py", + ) -def is_uuid(uuid: Any) -> bool: - try: - UUID(uuid) - return True - except (ValueError, AttributeError): - return False +def pytest_configure(config: pytest.Config) -> None: + """Add VCR.py markers to pytest.""" + config.addinivalue_line("markers", "vcr: mark the test as using VCR.py.") + + # Check if the test is not running in a CI environment + if config.getoption("vcr_record_mode") != RecordMode.NONE: + assert USERNAME != TEST_USERNAME + assert PASSWORD != TEST_PASSWORD + assert ACCOUNT_ID != TEST_ACCOUNT_ID + +@pytest.fixture(scope="session") +def record_mode(request: pytest.FixtureRequest) -> RecordMode: + """Return the record mode for VCR.py.""" + return request.config.getoption("vcr_record_mode", RecordMode.NONE) -def scrub_sub(match: re.Match) -> str: + +SENSITIVE_DATA = re.compile(rf"({USERNAME}|{PASSWORD}|{ACCOUNT_ID})") + + +def _scrub_sensitive_data(match: re.Match) -> str: if match.group() == USERNAME: - print("Scrubbed username") + LOGGER.warning("Scrubbed username") return TEST_USERNAME if match.group() == PASSWORD: - print("Scrubbed password") + LOGGER.warning("Scrubbed password") return TEST_PASSWORD if match.group() == ACCOUNT_ID: - print("Scrubbed account ID") + LOGGER.warning("Scrubbed account ID") return TEST_ACCOUNT_ID - if match.group() in [ - *DEXCOM_APPLICATION_IDS.values(), - TEST_ACCOUNT_ID, - TEST_SESSION_ID_EXPIRED, - DEFAULT_UUID, - ]: - return match.group() - print("Scrubbed session ID") - return TEST_SESSION_ID - - -def scrub_response(response: Dict[str, Any]) -> Dict[str, Any]: - if response["headers"].get("Content-Encoding") == ["gzip"]: - return response - body = response["body"]["string"].decode() - - body = re.sub( - rf"({USERNAME}|{PASSWORD}|{r_UUID})", - scrub_sub, - body, + return match.group() + + +def scrub_sensitive_data(string: str) -> str: + """Scrub sensitive data from the string.""" + return SENSITIVE_DATA.sub( + _scrub_sensitive_data, + string, ) - response["body"]["string"] = body.encode() +def scrub_response(response: dict[str, Any]) -> dict[str, Any]: + """Scrub sensitive data from the response.""" + if response["headers"].get("Content-Type") == ["application/json"]: + body = response["body"]["string"].decode() + try: + uuid = UUID(body.strip('"')) + if str(uuid) in {TEST_ACCOUNT_ID, TEST_SESSION_ID, DEFAULT_UUID}: + pass + # Replace account ID with test account ID + elif uuid == UUID(ACCOUNT_ID): + LOGGER.warning("Scrubbed account ID %s with %s", uuid, TEST_ACCOUNT_ID) + body = body.replace(str(uuid), TEST_ACCOUNT_ID) + # Replace session ID with test session ID + else: + LOGGER.warning("Scrubbed session ID %s with %s", uuid, TEST_SESSION_ID) + body = body.replace(str(uuid), TEST_SESSION_ID) + except ValueError: + pass + response["body"]["string"] = body.encode() return response -def scrub(key: str, value: Any, request: pytest.FixtureRequest) -> Any: # type: ignore +def scrub_parameter(key: str, value: Any, request: Request) -> Any: # noqa: ANN401, ARG001 + """Scrub sensitive data from the request parameters.""" if isinstance(value, str): - return re.sub( - rf"({USERNAME}|{PASSWORD}|{r_UUID})", - scrub_sub, # type: ignore - value, - ) + return scrub_sensitive_data(value) return value -def scrub_path(path: str) -> str: - return re.sub(rf"({USERNAME}|{PASSWORD}|{r_UUID})", scrub_sub, path) + ".yaml" - - -def pytest_addoption(parser: pytest.Parser) -> None: # type: ignore - group = parser.getgroup("vcr") - group.addoption( - "--record-mode", - action="store", - dest="vcr_record", - default=None, - choices=["once", "new_episodes", "none", "all"], - help="Set the recording mode for VCR.py", - ) +def scrub_session_id(key: str, value: Any, request: Request) -> Any: # noqa: ANN401, ARG001 + """Scrub session ID from the request query.""" + try: + uuid = UUID(value) + # Replace session ID with test session ID + if str(uuid) not in {TEST_SESSION_ID_EXPIRED, DEFAULT_UUID}: + LOGGER.warning("Scrubbed session ID %s with %s", uuid, TEST_SESSION_ID) + return TEST_SESSION_ID + except ValueError: + return value -def pytest_configure(config: pytest.Config) -> None: # type: ignore - config.addinivalue_line("markers", "vcr: mark the test as using VCR.py.") +def scrub_path(path: str) -> str: + """Scrub sensitive data from the cassette path.""" + return scrub_sensitive_data(path) -@pytest.fixture(scope="package") -def vcr(request: pytest.FixtureRequest) -> VCR: # type: ignore +@pytest.fixture(scope="session") +def vcr( + request: pytest.FixtureRequest, + record_mode: RecordMode, +) -> VCR: + """Generate a VCR fixture.""" return VCR( filter_post_data_parameters=[ - ("accountName", scrub), - ("accountId", scrub), - ("password", scrub), + ("accountName", scrub_parameter), + ("accountId", scrub_parameter), + ("password", scrub_parameter), ], filter_query_parameters=[ - ("sessionId", scrub), + ("sessionId", scrub_session_id), ], before_record_response=scrub_response, match_on=["uri", "method", "path", "query", "body"], path_transformer=scrub_path, - record_mode=RecordMode(request.config.getoption("--record-mode") or "none"), - cassette_library_dir=str(request.path.parent), + record_mode=record_mode, + cassette_library_dir=str(Path(request.config.rootpath) / "tests" / "cassettes"), ) -def vcr_cassette_path(request: Any, fixture: bool = False) -> str: # type: ignore - path = Path("cassettes") - name = Path( - (request.fixturename if fixture else request.node.name) or pytest.fail() - ) - if request.scope == "session": - return str(path / name) - - path = path / request.path.stem - if request.scope == "module": - return str(path / name) - - if request.cls: - name = request.cls.__name__ / name +def cassette_path( + request: pytest.FixtureRequest, + *, + autouse: bool = False, +) -> str: + """Generate a cassette path based on the request fixture.""" + cassette_path: Path = Path() + + if module := getattr(request, "module", None): + cassette_path /= Path(*module.__name__.split(".")) + + if cls := getattr(request, "cls", None): + # Class scoped fixture used in class. + cassette_path /= cls.__name__ + elif request.scope == "class": + # Class scoped fixture used in function. + cassette_path /= request.node.name + + if getattr(request, "function", None): + cassette_path /= request.node.name + + if request.scope in {"session", "package", "module"}: + cassette_path /= request.fixturename or request.node.name + else: + cassette_path /= ( + request.node.name if autouse else (request.fixturename or request.node.name) + ) - return str(path / name) + return str(cassette_path.with_suffix(".yaml")) @pytest.fixture(autouse=True) -def _vcr_marker(request: pytest.FixtureRequest, vcr: VCR) -> Generator: # type: ignore +def _vcr_marker_autouse( + request: pytest.FixtureRequest, + vcr: VCR, +) -> Iterator[Union[Cassette, None]]: if request.node.get_closest_marker("vcr"): - with vcr.use_cassette(vcr_cassette_path(request)) as cassette: + with vcr.use_cassette(cassette_path(request, autouse=True)) as cassette: yield cassette + else: + yield None diff --git a/tests/requirements.txt b/tests/requirements.txt deleted file mode 100644 index 4ed9da6..0000000 --- a/tests/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -pytest -vcrpy \ No newline at end of file diff --git a/tests/test_dexcom.py b/tests/test_dexcom.py index 497b4a2..cb16ca8 100644 --- a/tests/test_dexcom.py +++ b/tests/test_dexcom.py @@ -1,24 +1,31 @@ +"""Tests for the Dexcom class in the pydexcom package.""" + from contextlib import nullcontext as does_not_raise -from typing import Any, Optional, Union +from typing import TYPE_CHECKING, Any from uuid import UUID import pytest -from pydexcom import ( - DEFAULT_UUID, +from pydexcom import Dexcom, Region +from pydexcom.const import DEFAULT_UUID +from pydexcom.errors import ( AccountError, AccountErrorEnum, ArgumentError, ArgumentErrorEnum, - Dexcom, - valid_uuid, ) +from pydexcom.util import valid_uuid + +from .conftest import ACCOUNT_ID, PASSWORD, REGION, TEST_ACCOUNT_ID, USERNAME -from .conftest import ACCOUNT_ID, PASSWORD, USERNAME +if TYPE_CHECKING: + from _pytest.python_api import RaisesContext -@pytest.mark.vcr() +@pytest.mark.vcr class TestDexcom: + """Test class for Dexcom authentication.""" + @pytest.mark.parametrize( "password", [None, "", 1, "password", PASSWORD], @@ -31,55 +38,79 @@ class TestDexcom: "username", [None, "", 1, "username", USERNAME], ) - def test_dexcom(self, password: Any, account_id: Any, username: Any) -> None: - raises: Any = does_not_raise() - expected: Optional[Union[ArgumentErrorEnum, AccountErrorEnum]] = None + @pytest.mark.parametrize( + "region", + [None, "", "region", Region.OUS, REGION], + ) + def test_dexcom( # noqa: C901 + self, + password: Any, # noqa: ANN401 + account_id: Any, # noqa: ANN401 + username: Any, # noqa: ANN401 + region: Any, # noqa: ANN401 + ) -> None: + """Test the Dexcom class for authentication.""" + enum: ArgumentErrorEnum | AccountErrorEnum | None + raises: ( + RaisesContext[ArgumentError] | RaisesContext[AccountError] | does_not_raise + ) - if username is None and account_id is None: + if not region or region not in list(Region): + raises = pytest.raises(ArgumentError) + enum = ArgumentErrorEnum.REGION_INVALID + elif username is None and account_id is None: raises = pytest.raises(ArgumentError) - expected = ArgumentErrorEnum.NONE_USER_ID_PROVIDED + enum = ArgumentErrorEnum.USER_ID_REQUIRED elif username is not None and account_id is not None: raises = pytest.raises(ArgumentError) - expected = ArgumentErrorEnum.TOO_MANY_USER_ID_PROVIDED + enum = ArgumentErrorEnum.USER_ID_MULTIPLE elif not password or not isinstance(password, str): raises = pytest.raises(ArgumentError) - expected = ArgumentErrorEnum.PASSWORD_INVALID + enum = ArgumentErrorEnum.PASSWORD_INVALID elif account_id is None and (not username or not isinstance(username, str)): raises = pytest.raises(ArgumentError) - expected = ArgumentErrorEnum.USERNAME_INVALID + enum = ArgumentErrorEnum.USERNAME_INVALID elif username is None and ( not account_id or not isinstance(account_id, str) or not valid_uuid(str(account_id)) ): raises = pytest.raises(ArgumentError) - expected = ArgumentErrorEnum.ACCOUNT_ID_INVALID + enum = ArgumentErrorEnum.ACCOUNT_ID_INVALID elif ( (account_id is None and username != USERNAME) or (username is None and account_id != ACCOUNT_ID) or (account_id is None and username == USERNAME and password != PASSWORD) or (account_id == ACCOUNT_ID and username is None and password != PASSWORD) + or (region != REGION) ): raises = pytest.raises(AccountError) - expected = AccountErrorEnum.FAILED_AUTHENTICATION + enum = AccountErrorEnum.FAILED_AUTHENTICATION elif (account_id is None and username == USERNAME and password == PASSWORD) or ( account_id == ACCOUNT_ID and username is None and password == PASSWORD ): - pass + raises = does_not_raise() + enum = None else: - pytest.fail() - - print(expected) + pytest.fail("Unexpected test case") with raises as error: - dexcom = Dexcom(password=password, account_id=account_id, username=username) + dexcom = Dexcom( + password=password, + account_id=account_id, + username=username, + region=region, + ) - assert dexcom._username == username - assert dexcom._password == password + if username is not None: + assert dexcom._username == USERNAME + if account_id is not None: + assert dexcom._account_id == ACCOUNT_ID + assert dexcom._account_id in {ACCOUNT_ID, TEST_ACCOUNT_ID} + assert dexcom._password == PASSWORD assert dexcom._account_id != DEFAULT_UUID - # assert dexcom._account_id == ACCOUNT_ID assert UUID(dexcom._session_id) assert dexcom._session_id != DEFAULT_UUID return - assert error.value.enum == expected + assert error.value.enum == enum diff --git a/tests/test_glucose_reading.py b/tests/test_glucose_reading.py index b35bd2e..3b1a8ec 100644 --- a/tests/test_glucose_reading.py +++ b/tests/test_glucose_reading.py @@ -1,45 +1,59 @@ +"""Tests for the GlucoseReading class in the pydexcom package.""" + from contextlib import nullcontext as does_not_raise from datetime import datetime -from typing import Any +from typing import TYPE_CHECKING, Any import pytest from vcr import VCR -from pydexcom import ( +from pydexcom.const import ( DEXCOM_TREND_DIRECTIONS, MAX_MAX_COUNT, MAX_MINUTES, +) +from pydexcom.dexcom import Dexcom +from pydexcom.errors import ( ArgumentError, ArgumentErrorEnum, - Dexcom, ) -from .conftest import ACCOUNT_ID, PASSWORD, TEST_SESSION_ID_EXPIRED, vcr_cassette_path +from .conftest import ACCOUNT_ID, PASSWORD, TEST_SESSION_ID_EXPIRED, cassette_path + +if TYPE_CHECKING: + from _pytest.python_api import RaisesContext @pytest.fixture(scope="class") -def dexcom(request: pytest.FixtureRequest, vcr: VCR) -> Dexcom: # type:ignore - with vcr.use_cassette(path=vcr_cassette_path(request, fixture=True)): +def dexcom(request: pytest.FixtureRequest, vcr: VCR) -> Dexcom: + """Fixture to create a Dexcom instance for testing.""" + with vcr.use_cassette(cassette_path(request)): return Dexcom(account_id=ACCOUNT_ID, password=PASSWORD) -@pytest.mark.vcr() +@pytest.mark.vcr class TestGlucoseReading: + """Test class for Dexcom glucose reading functionality.""" + @pytest.mark.parametrize("minutes", [None, "", "15", 0, 0.5, 1441, 10]) @pytest.mark.parametrize("max_count", [None, "", "2", 0, 0.5, 289, 1]) def test_get_glucose_readings( - self, dexcom: Dexcom, minutes: Any, max_count: Any + self, + dexcom: Dexcom, + minutes: Any, # noqa: ANN401 + max_count: Any, # noqa: ANN401 ) -> None: - raises = does_not_raise() + """Test the get_glucose_readings method of Dexcom.""" + raises: RaisesContext[ArgumentError] | does_not_raise = does_not_raise() expected = None if not isinstance(minutes, int) or any([minutes < 0, minutes > MAX_MINUTES]): - raises = pytest.raises(ArgumentError) # type: ignore + raises = pytest.raises(ArgumentError) expected = ArgumentErrorEnum.MINUTES_INVALID elif not isinstance(max_count, int) or any( - [max_count < 0, max_count > MAX_MAX_COUNT] + [max_count < 0, max_count > MAX_MAX_COUNT], ): - raises = pytest.raises(ArgumentError) # type: ignore + raises = pytest.raises(ArgumentError) expected = ArgumentErrorEnum.MAX_COUNT_INVALID with raises as error: @@ -52,7 +66,7 @@ def test_get_glucose_readings( assert glucose_reading is not None assert isinstance(glucose_reading.value, int) assert glucose_reading.value >= 0 - assert glucose_reading.value <= 400 + assert glucose_reading.value <= 400 # noqa: PLR2004 assert isinstance(glucose_reading.trend_direction, str) assert glucose_reading.trend_direction in DEXCOM_TREND_DIRECTIONS @@ -69,11 +83,14 @@ def test_get_glucose_readings( assert error.value.enum == expected def test_get_latest_glucose_reading(self, dexcom: Dexcom) -> None: + """Test the get_latest_glucose_reading method of Dexcom.""" dexcom.get_latest_glucose_reading() def test_get_current_glucose_reading(self, dexcom: Dexcom) -> None: + """Test the get_current_glucose_reading method of Dexcom.""" dexcom.get_current_glucose_reading() def test_get_current_glucose_reading_session_expired(self, dexcom: Dexcom) -> None: + """Test the get_current_glucose_reading method of Dexcom, session expiration.""" dexcom._session_id = TEST_SESSION_ID_EXPIRED dexcom.get_current_glucose_reading()