Skip to content

Commit 9d00b5c

Browse files
Merge pull request #16 from Riminder/fix/uuid-collision
Fix: replace uuid4 by uuid1 in test to avoid collision
2 parents 244f8a6 + a83f4a5 commit 9d00b5c

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "hrflow"
3-
version = "3.2.1"
3+
version = "3.2.2"
44
description = "Python hrflow.ai API package"
55
authors = ["HrFlow.ai <contact@hrflow.ai>"]
66
license = "MIT"

tests/test_job.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import typing as t
2-
from uuid import uuid4
2+
from uuid import uuid1
33

44
import pytest
55
from requests import codes as http_codes
@@ -31,7 +31,7 @@ def hrflow_client():
3131

3232
def _job_get() -> t.Dict[str, t.Any]:
3333
return dict(
34-
reference=str(uuid4()),
34+
reference=str(uuid1()),
3535
name="r&d engineer",
3636
location=dict(text="7 rue 4 septembre paris", lat=48.869179, lng=2.33814),
3737
sections=[
@@ -229,7 +229,7 @@ def test_job_editing_basic(hrflow_client):
229229
BOARD_KEY = _var_from_env_get("HRFLOW_BOARD_KEY")
230230
mock_job = _indexed_response_get(hrflow_client, BOARD_KEY, _job_get()).data
231231
mock_job.interviews = (
232-
f"To access the interview call you must use the token {uuid4()}."
232+
f"To access the interview call you must use the token {uuid1()}."
233233
)
234234
model = JobIndexingResponse.model_validate(
235235
hrflow_client.job.storing.edit(

tests/test_profile.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import json
22
import typing as t
33
from time import sleep
4-
from uuid import uuid4
4+
from uuid import uuid1
55

66
import pytest
77
from requests import codes as http_codes
@@ -40,7 +40,7 @@ def hrflow_client():
4040

4141
def _profile_get() -> t.Dict[str, t.Any]:
4242
return dict(
43-
reference=str(uuid4()),
43+
reference=str(uuid1()),
4444
text_language="en",
4545
text=(
4646
"Harry James PotterSorcerer Apprenticedate of birth: June 26th 1997Number"
@@ -320,7 +320,7 @@ def test_profile_parsing_file_quicksilver_async_basic(hrflow_client):
320320
teams/fc9d40fd60e679119130ea74ae1d34a3e22174f2/sources/06d96aab2661b16eaf4d34d385d\
321321
3c2b0cf00c0eb/profiles/d79768fb63013a8bdd04e7e8742cc84afd428a87/parsing/resume.pdf"""
322322
file = _file_get(s3_url, "profile_async")
323-
reference = str(uuid4())
323+
reference = str(uuid1())
324324
model = ProfileParsingFileResponse.model_validate(
325325
hrflow_client.profile.parsing.add_file(
326326
source_key=SOURCE_KEY,
@@ -400,7 +400,7 @@ def test_profile_parsing_file_mozart_async_basic(hrflow_client):
400400
teams/fc9d40fd60e679119130ea74ae1d34a3e22174f2/sources/06d96aab2661b16eaf4d34d385d\
401401
3c2b0cf00c0eb/profiles/d79768fb63013a8bdd04e7e8742cc84afd428a87/parsing/resume.pdf"""
402402
file = _file_get(s3_url, "profile_async")
403-
reference = str(uuid4())
403+
reference = str(uuid1())
404404
model = ProfileParsingFileResponse.model_validate(
405405
hrflow_client.profile.parsing.add_file(
406406
source_key=SOURCE_KEY,
@@ -632,7 +632,7 @@ def test_profile_archive_basic(hrflow_client):
632632
def test_profile_editing_basic(hrflow_client):
633633
SOURCE_KEY = _var_from_env_get("HRFLOW_SOURCE_KEY_QUICKSILVER_SYNC")
634634
mock_profile = _indexed_response_get(hrflow_client, SOURCE_KEY, _profile_get()).data
635-
mock_profile.text = f"The password of my bitcoin wallet is {uuid4()}."
635+
mock_profile.text = f"The password of my bitcoin wallet is {uuid1()}."
636636
model = ProfileIndexingResponse.model_validate(
637637
hrflow_client.profile.storing.edit(
638638
source_key=SOURCE_KEY,

0 commit comments

Comments
 (0)