You've already forked hotpocket
This commit is contained in:
3
services/packages/testing/README.md
Normal file
3
services/packages/testing/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# HotPocket by BTHLabs
|
||||
|
||||
This repository contains the _HotPocket Testing_ project.
|
||||
@@ -0,0 +1 @@
|
||||
from .datetime import assert_datetimes_are_really_close # noqa: F401,F403
|
||||
@@ -0,0 +1,14 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import annotations
|
||||
|
||||
import datetime
|
||||
|
||||
import dateutil
|
||||
|
||||
DELTA = datetime.timedelta(microseconds=100_000) # 100ms
|
||||
|
||||
|
||||
def assert_datetimes_are_really_close(datetime1: datetime.datetime,
|
||||
datetime2: datetime.datetime,
|
||||
):
|
||||
assert dateutil.utils.within_delta(datetime1, datetime2, DELTA)
|
||||
@@ -0,0 +1,2 @@
|
||||
from .celery import * # noqa: F401,F403
|
||||
from .common import * # noqa: F401,F403
|
||||
@@ -0,0 +1,16 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# type: ignore
|
||||
from __future__ import annotations
|
||||
|
||||
from unittest import mock
|
||||
|
||||
from celery.result import AsyncResult
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def async_result(null_uuid) -> mock.Mock:
|
||||
result = mock.Mock(spec=AsyncResult)
|
||||
result.id = str(null_uuid)
|
||||
|
||||
return result
|
||||
@@ -0,0 +1,12 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# type: ignore
|
||||
from __future__ import annotations
|
||||
|
||||
import uuid
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def null_uuid():
|
||||
return uuid.UUID('00000000-0000-0000-0000-000000000000')
|
||||
4
services/packages/testing/hotpocket_testing/plugin.py
Normal file
4
services/packages/testing/hotpocket_testing/plugin.py
Normal file
@@ -0,0 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import annotations
|
||||
|
||||
from .fixtures import * # noqa: F401,F403
|
||||
18
services/packages/testing/pyproject.toml
Normal file
18
services/packages/testing/pyproject.toml
Normal file
@@ -0,0 +1,18 @@
|
||||
[tool.poetry]
|
||||
name = "hotpocket-testing"
|
||||
version = "1.0.0.dev0"
|
||||
description = "HotPocket Testing"
|
||||
authors = ["Tomek Wójcik <contact@bthlabs.pl>"]
|
||||
license = "Apache-2.0"
|
||||
readme = "README.md"
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.12"
|
||||
python-dateutil = "2.9.0.post0"
|
||||
|
||||
[tool.poetry.plugins.pytest11]
|
||||
hotpocket_testing = "hotpocket_testing.plugin"
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core"]
|
||||
build-backend = "poetry.core.masonry.api"
|
||||
Reference in New Issue
Block a user