Skip to content

Commit

Permalink
test: update DI random identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-JB committed Dec 5, 2024
1 parent ab7be5f commit 9ee1632
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/connectors/document_index/test_document_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,14 @@ def random_alphanumeric_string(length: int = 20) -> str:
def random_identifier() -> str:
name = random_alphanumeric_string(10)
timestamp = datetime.now(timezone.utc).strftime("%Y%m%dT%H%M%S")
return f"ci-il-{name}-{timestamp}"
return f"intelligence-layer-ci-{name}-{timestamp}"


def is_outdated_identifier(identifier: str, timestamp_threshold: datetime) -> bool:
# match the format that is defined in random_identifier()
matched = re.match(
r"^ci-il-[a-zA-Z0-9]{20}-(?P<timestamp>\d{8}T\d{6})$", identifier
r"^intelligence-layer-ci-[a-zA-Z0-9]{10}-(?P<timestamp>\d{8}T\d{6})$",
identifier,
)
if matched is None:
return False
Expand Down

0 comments on commit 9ee1632

Please sign in to comment.