Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 9c21fc5

Browse files
committed
Flatten project
1 parent d2fbef0 commit 9c21fc5

File tree

6 files changed

+47
-50
lines changed

6 files changed

+47
-50
lines changed
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
from abc import ABC, abstractmethod
22
from dataclasses import dataclass
3-
from typing import Any, Iterable, Optional
3+
from typing import Any, Iterable, Optional, Mapping, Sequence, Union
4+
from decimal import Decimal
45

56
from mypy_boto3_dynamodb.service_resource import DynamoDBServiceResource
67

7-
from .types import DynamoDBItem
8+
9+
PrimitiveDynamoDBValues = Optional[Union[str, int, float, Decimal, bool]]
10+
DynamoDBValues = Union[
11+
PrimitiveDynamoDBValues,
12+
Mapping[str, PrimitiveDynamoDBValues],
13+
Sequence[PrimitiveDynamoDBValues],
14+
]
15+
DynamoDBItem = Mapping[str, DynamoDBValues]
816

917

1018
@dataclass(frozen=True)

dynamodb_autoincrement/tests/__init__.py

Whitespace-only changes.

dynamodb_autoincrement/tests/conftest.py

Lines changed: 0 additions & 36 deletions
This file was deleted.

dynamodb_autoincrement/types.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pytest-cov = "^4.1.0"
2020

2121
[tool.coverage.run]
2222
omit = [
23-
"*/tests/*",
23+
"test_*.py",
2424
]
2525

2626
[tool.coverage.report]

dynamodb_autoincrement/tests/test_autoincrement.py renamed to test_dynamodb_autoincrement.py

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,47 @@
22
from botocore.exceptions import ClientError
33
import pytest
44

5-
from .. import DynamoDBAutoIncrement, DynamoDBHistoryAutoIncrement
5+
from dynamodb_autoincrement import DynamoDBAutoIncrement, DynamoDBHistoryAutoIncrement
66

77

88
N = 20
99

1010

11+
@pytest.fixture
12+
def create_tables(dynamodb):
13+
for kwargs in [
14+
{
15+
"AttributeDefinitions": [
16+
{"AttributeName": "tableName", "AttributeType": "S"}
17+
],
18+
"BillingMode": "PAY_PER_REQUEST",
19+
"KeySchema": [{"AttributeName": "tableName", "KeyType": "HASH"}],
20+
"TableName": "autoincrement",
21+
},
22+
{
23+
"BillingMode": "PAY_PER_REQUEST",
24+
"AttributeDefinitions": [
25+
{"AttributeName": "widgetID", "AttributeType": "N"}
26+
],
27+
"KeySchema": [{"AttributeName": "widgetID", "KeyType": "HASH"}],
28+
"TableName": "widgets",
29+
},
30+
{
31+
"BillingMode": "PAY_PER_REQUEST",
32+
"AttributeDefinitions": [
33+
{"AttributeName": "widgetID", "AttributeType": "N"},
34+
{"AttributeName": "version", "AttributeType": "N"},
35+
],
36+
"KeySchema": [
37+
{"AttributeName": "widgetID", "KeyType": "HASH"},
38+
{"AttributeName": "version", "KeyType": "RANGE"},
39+
],
40+
"TableName": "widgetHistory",
41+
},
42+
]:
43+
dynamodb.create_table(**kwargs)
44+
45+
1146
@pytest.fixture
1247
def autoincrement_safely(dynamodb, create_tables):
1348
return DynamoDBAutoIncrement(

0 commit comments

Comments
 (0)