Move tests directory

dev
Kyle Prestel 2021-07-31 08:40:29 -04:00
rodzic 27b9b052ef
commit 993ba05f6c
8 zmienionych plików z 256 dodań i 563 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -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

0
bin/start-nextcloud.sh 100644 → 100755
Wyświetl plik

Wyświetl plik

@ -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)

784
poetry.lock wygenerowano

Plik diff jest za duży Load Diff

Wyświetl plik

@ -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"]

Wyświetl plik

@ -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,