
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
from freeze_uuid import freeze_uuid
@freeze_uuid('12af6b44-8181-11ee-b890-628ab7cd4d99')
def test_uuid():
assert str(uuid.uuid1()) == '12af6b44-8181-11ee-b890-628ab7cd4d99'
assert str(uuid.uuid4()) == '12af6b44-8181-11ee-b890-628ab7cd4d99'
@freeze_uuid()
def test_uuid_default():
assert str(uuid.uuid1()) == '00000000-0000-0000-0000-000000000000'
assert str(uuid.uuid4()) == '00000000-0000-0000-0000-000000000000'
@pytest.mark.asyncio
@freeze_uuid('12af6b44-8181-11ee-b890-628ab7cd4d99')
async def test_uuid_async():
assert str(uuid.uuid1()) == '12af6b44-8181-11ee-b890-628ab7cd4d99'
assert str(uuid.uuid4()) == '12af6b44-8181-11ee-b890-628ab7cd4d99'
@freeze_uuid(['12af6b44-8181-11ee-b890-628ab7cd4d99', '12af6b44-8181-11ee-b890-628ab7cd4d98'])
def test_uuid_list():
assert str(uuid.uuid1()) == '12af6b44-8181-11ee-b890-628ab7cd4d99'
assert str(uuid.uuid4()) == '12af6b44-8181-11ee-b890-628ab7cd4d98'
assert str(uuid.uuid4()) == '12af6b44-8181-11ee-b890-628ab7cd4d98'
assert str(uuid.uuid4()) == '12af6b44-8181-11ee-b890-628ab7cd4d98'
from uuid_extensions import uuid7
@freeze_uuid(TEST_UUID)
def test_uuid_7():
assert str(uuid7()) == TEST_UUID
from freeze_uuid import freeze_uuid_manager
@pytest.mark.parametrize(
['expected_result', 'freeze_data'],
[
pytest.param(
TEST_UUID_2,
[TEST_UUID_2],
),
pytest.param(
TEST_UUID_3,
[TEST_UUID_3],
),
pytest.param(
TEST_UUID_4,
[TEST_UUID_4],
),
pytest.param(
TEST_UUID_5,
[TEST_UUID_5],
),
]
)
def test_parametrize(expected_result, freeze_data):
with freeze_uuid_manager(freeze_data):
assert str(uuid.uuid4()) == expected_result
FAQs
Python package for mocking uuid.
We found that freeze-uuid demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.