kopia lustrzana https://github.com/kprestel/nextcloud-deck
Move tests directory
rodzic
27b9b052ef
commit
993ba05f6c
|
@ -1,3 +1,3 @@
|
|||
FROM ghcr.io/linuxserver/nextcloud
|
||||
COPY test/data /data
|
||||
COPY test/config /config
|
||||
COPY tests/data /data
|
||||
COPY tests/config /config
|
||||
|
|
13
Makefile
13
Makefile
|
@ -1,5 +1,5 @@
|
|||
.PHONY: clean-pyc test clean-build
|
||||
TEST_PATH=tests
|
||||
TEST_PATH=test
|
||||
|
||||
clean-pyc:
|
||||
find . -name '*.pyc' -exec rm --force {} +
|
||||
|
@ -20,12 +20,12 @@ isort:
|
|||
lint:
|
||||
flake8 --exclude=.tox
|
||||
|
||||
test: clean-pyc
|
||||
test: clean-pyc build-test start-nextcloud-test-instance
|
||||
tox
|
||||
|
||||
black:
|
||||
black deck/
|
||||
black test/
|
||||
black tests/
|
||||
|
||||
create-volumes:
|
||||
docker volume create nextcloud-data
|
||||
|
@ -34,10 +34,15 @@ create-volumes:
|
|||
build-test-image:
|
||||
docker build -t nextcloud-test .
|
||||
|
||||
build-test: create-volumes build-test-image
|
||||
|
||||
build:
|
||||
poetry build
|
||||
|
||||
deploy: build
|
||||
poetry publish
|
||||
|
||||
publish: deploy
|
||||
publish: deploy
|
||||
|
||||
start-nextcloud-test-instance:
|
||||
./bin/start-nextcloud.sh
|
||||
|
|
|
@ -5,7 +5,6 @@ import typing
|
|||
|
||||
import attr
|
||||
import cattr
|
||||
import dateutil
|
||||
from cattr.preconf.json import make_converter
|
||||
from dateutil.parser import parse
|
||||
|
||||
|
@ -30,10 +29,10 @@ def json_to_snake(d):
|
|||
}
|
||||
|
||||
|
||||
def deserialize(model: typing.Generic[T]) -> T:
|
||||
def deserialize(model: typing.Generic[T]) -> typing.Callable:
|
||||
def outer(fn):
|
||||
@functools.wraps(fn)
|
||||
def inner(*args, **kwargs):
|
||||
def inner(*args, **kwargs) -> T:
|
||||
json_ = fn(*args, **kwargs)
|
||||
json_ = json_to_snake(json_)
|
||||
return cattr.structure(json_, model)
|
||||
|
@ -71,8 +70,8 @@ class Card:
|
|||
archived: bool
|
||||
notified: bool = False
|
||||
deleted_at: int = 0
|
||||
duedate: str = None
|
||||
description: str = None
|
||||
duedate: typing.Optional[str] = None
|
||||
description: typing.Optional[str] = None
|
||||
type: str = "plain"
|
||||
labels: typing.Optional[typing.List[Label]] = attr.Factory(list)
|
||||
|
||||
|
|
Plik diff jest za duży
Load Diff
|
@ -17,11 +17,12 @@ dateutils = "^0.6.12"
|
|||
|
||||
[tool.poetry.dev-dependencies]
|
||||
pytest = "^6.2.4"
|
||||
black = "^21.6b0"
|
||||
black = { version = "*", allow-prereleases = true }
|
||||
mypy = "^0.902"
|
||||
isort = "^5.8.0"
|
||||
tox = "^3.23.1"
|
||||
tox-poetry = "^0.4.0"
|
||||
flake8-black = "^0.2.1"
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry>=0.12"]
|
||||
|
|
6
tox.ini
6
tox.ini
|
@ -16,6 +16,12 @@ deps = flake8
|
|||
commands = flake8
|
||||
|
||||
[flake8]
|
||||
# Recommend matching the black line length (default 88),
|
||||
# rather than using the flake8 default of 79:
|
||||
max-line-length = 88
|
||||
extend-ignore =
|
||||
# See https://github.com/PyCQA/pycodestyle/issues/373
|
||||
E203,
|
||||
ignore = F401
|
||||
exclude =
|
||||
.git,
|
||||
|
|
Ładowanie…
Reference in New Issue