kopia lustrzana https://github.com/kprestel/nextcloud-deck
Move tests directory
rodzic
27b9b052ef
commit
993ba05f6c
|
@ -1,3 +1,3 @@
|
||||||
FROM ghcr.io/linuxserver/nextcloud
|
FROM ghcr.io/linuxserver/nextcloud
|
||||||
COPY test/data /data
|
COPY tests/data /data
|
||||||
COPY test/config /config
|
COPY tests/config /config
|
||||||
|
|
11
Makefile
11
Makefile
|
@ -1,5 +1,5 @@
|
||||||
.PHONY: clean-pyc test clean-build
|
.PHONY: clean-pyc test clean-build
|
||||||
TEST_PATH=tests
|
TEST_PATH=test
|
||||||
|
|
||||||
clean-pyc:
|
clean-pyc:
|
||||||
find . -name '*.pyc' -exec rm --force {} +
|
find . -name '*.pyc' -exec rm --force {} +
|
||||||
|
@ -20,12 +20,12 @@ isort:
|
||||||
lint:
|
lint:
|
||||||
flake8 --exclude=.tox
|
flake8 --exclude=.tox
|
||||||
|
|
||||||
test: clean-pyc
|
test: clean-pyc build-test start-nextcloud-test-instance
|
||||||
tox
|
tox
|
||||||
|
|
||||||
black:
|
black:
|
||||||
black deck/
|
black deck/
|
||||||
black test/
|
black tests/
|
||||||
|
|
||||||
create-volumes:
|
create-volumes:
|
||||||
docker volume create nextcloud-data
|
docker volume create nextcloud-data
|
||||||
|
@ -34,6 +34,8 @@ create-volumes:
|
||||||
build-test-image:
|
build-test-image:
|
||||||
docker build -t nextcloud-test .
|
docker build -t nextcloud-test .
|
||||||
|
|
||||||
|
build-test: create-volumes build-test-image
|
||||||
|
|
||||||
build:
|
build:
|
||||||
poetry build
|
poetry build
|
||||||
|
|
||||||
|
@ -41,3 +43,6 @@ deploy: build
|
||||||
poetry publish
|
poetry publish
|
||||||
|
|
||||||
publish: deploy
|
publish: deploy
|
||||||
|
|
||||||
|
start-nextcloud-test-instance:
|
||||||
|
./bin/start-nextcloud.sh
|
||||||
|
|
|
@ -5,7 +5,6 @@ import typing
|
||||||
|
|
||||||
import attr
|
import attr
|
||||||
import cattr
|
import cattr
|
||||||
import dateutil
|
|
||||||
from cattr.preconf.json import make_converter
|
from cattr.preconf.json import make_converter
|
||||||
from dateutil.parser import parse
|
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):
|
def outer(fn):
|
||||||
@functools.wraps(fn)
|
@functools.wraps(fn)
|
||||||
def inner(*args, **kwargs):
|
def inner(*args, **kwargs) -> T:
|
||||||
json_ = fn(*args, **kwargs)
|
json_ = fn(*args, **kwargs)
|
||||||
json_ = json_to_snake(json_)
|
json_ = json_to_snake(json_)
|
||||||
return cattr.structure(json_, model)
|
return cattr.structure(json_, model)
|
||||||
|
@ -71,8 +70,8 @@ class Card:
|
||||||
archived: bool
|
archived: bool
|
||||||
notified: bool = False
|
notified: bool = False
|
||||||
deleted_at: int = 0
|
deleted_at: int = 0
|
||||||
duedate: str = None
|
duedate: typing.Optional[str] = None
|
||||||
description: str = None
|
description: typing.Optional[str] = None
|
||||||
type: str = "plain"
|
type: str = "plain"
|
||||||
labels: typing.Optional[typing.List[Label]] = attr.Factory(list)
|
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]
|
[tool.poetry.dev-dependencies]
|
||||||
pytest = "^6.2.4"
|
pytest = "^6.2.4"
|
||||||
black = "^21.6b0"
|
black = { version = "*", allow-prereleases = true }
|
||||||
mypy = "^0.902"
|
mypy = "^0.902"
|
||||||
isort = "^5.8.0"
|
isort = "^5.8.0"
|
||||||
tox = "^3.23.1"
|
tox = "^3.23.1"
|
||||||
tox-poetry = "^0.4.0"
|
tox-poetry = "^0.4.0"
|
||||||
|
flake8-black = "^0.2.1"
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry>=0.12"]
|
requires = ["poetry>=0.12"]
|
||||||
|
|
6
tox.ini
6
tox.ini
|
@ -16,6 +16,12 @@ deps = flake8
|
||||||
commands = flake8
|
commands = flake8
|
||||||
|
|
||||||
[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
|
ignore = F401
|
||||||
exclude =
|
exclude =
|
||||||
.git,
|
.git,
|
||||||
|
|
Ładowanie…
Reference in New Issue