mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-25 08:55:50 +00:00
Merge pull request #894 from pimutils/optimise-test-servers
Move test server dockerfiles out-of-repo
This commit is contained in:
commit
2336076baf
9 changed files with 21 additions and 54 deletions
6
.gitmodules
vendored
6
.gitmodules
vendored
|
|
@ -1,6 +0,0 @@
|
|||
[submodule "tests/storage/servers/owncloud"]
|
||||
path = tests/storage/servers/owncloud
|
||||
url = https://github.com/vdirsyncer/owncloud-testserver
|
||||
[submodule "tests/storage/servers/nextcloud"]
|
||||
path = tests/storage/servers/nextcloud
|
||||
url = https://github.com/vdirsyncer/nextcloud-testserver
|
||||
3
Makefile
3
Makefile
|
|
@ -63,9 +63,6 @@ all:
|
|||
install-servers:
|
||||
set -ex; \
|
||||
for server in $(DAV_SERVER); do \
|
||||
if [ ! "$$(ls $(TESTSERVER_BASE)$$server/)" ]; then \
|
||||
git submodule update --init -- "$(TESTSERVER_BASE)$$server"; \
|
||||
fi; \
|
||||
(cd $(TESTSERVER_BASE)$$server && sh install.sh); \
|
||||
done
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
FROM python:3.8
|
||||
|
||||
RUN pip install radicale
|
||||
|
||||
CMD radicale --storage-filesystem-folder /tmp/dav -H 0.0.0.0:8001 -D
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# Original file copyright 2017 Jelmer Vernooij
|
||||
|
||||
FROM ubuntu:bionic
|
||||
RUN apt-get update && apt-get -y install xandikos locales
|
||||
EXPOSE 8000
|
||||
|
||||
RUN locale-gen en_US.UTF-8
|
||||
ENV PYTHONIOENCODING=utf-8
|
||||
ENV LANG en_US.UTF-8
|
||||
ENV LANGUAGE en_US:en
|
||||
ENV LC_ALL en_US.UTF-8
|
||||
|
||||
CMD xandikos -d /tmp/dav -l 0.0.0.0 -p 8000 --autocreate
|
||||
|
|
@ -1 +0,0 @@
|
|||
Subproject commit a27144ddcf39a3283179a4f7ce1ab22b2e810205
|
||||
|
|
@ -1 +0,0 @@
|
|||
Subproject commit bb4fcc6f524467d58c95f1dcec8470fdfcd65adf
|
||||
|
|
@ -1,6 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
cd $(git rev-parse --show-toplevel)
|
||||
|
||||
docker build -t radicale docker/radicale
|
||||
docker run -d -p 8001:8001 radicale
|
||||
docker run -d -p 8001:8001 whynothugo/vdirsyncer-devkit-radicale
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
cd $(git rev-parse --show-toplevel)
|
||||
|
||||
docker build -t xandikos docker/xandikos
|
||||
docker run -d -p 8000:8000 xandikos
|
||||
docker run -d -p 8000:8000 whynothugo/vdirsyncer-devkit-xandikos
|
||||
|
|
|
|||
|
|
@ -46,38 +46,40 @@ class TestFilesystemStorage(StorageTests):
|
|||
|
||||
def test_ignore_tmp_files(self, tmpdir):
|
||||
"""Test that files with .tmp suffix beside .ics files are ignored."""
|
||||
s = self.storage_class(str(tmpdir), '.ics')
|
||||
s.upload(Item('UID:xyzxyz'))
|
||||
item_file, = tmpdir.listdir()
|
||||
item_file.copy(item_file.new(ext='tmp'))
|
||||
s = self.storage_class(str(tmpdir), ".ics")
|
||||
s.upload(Item("UID:xyzxyz"))
|
||||
(item_file,) = tmpdir.listdir()
|
||||
item_file.copy(item_file.new(ext="tmp"))
|
||||
assert len(tmpdir.listdir()) == 2
|
||||
assert len(list(s.list())) == 1
|
||||
|
||||
def test_ignore_tmp_files_empty_fileext(self, tmpdir):
|
||||
"""Test that files with .tmp suffix are ignored with empty fileext."""
|
||||
s = self.storage_class(str(tmpdir), '')
|
||||
s.upload(Item('UID:xyzxyz'))
|
||||
item_file, = tmpdir.listdir()
|
||||
item_file.copy(item_file.new(ext='tmp'))
|
||||
s = self.storage_class(str(tmpdir), "")
|
||||
s.upload(Item("UID:xyzxyz"))
|
||||
(item_file,) = tmpdir.listdir()
|
||||
item_file.copy(item_file.new(ext="tmp"))
|
||||
assert len(tmpdir.listdir()) == 2
|
||||
# assert False, tmpdir.listdir() # enable to see the created filename
|
||||
assert len(list(s.list())) == 1
|
||||
|
||||
def test_ignore_files_typical_backup(self, tmpdir):
|
||||
"""Test file-name ignorance with typical backup ending ~."""
|
||||
ignorext = "~" # without dot
|
||||
s = self.storage_class(str(tmpdir), '', fileignoreext="~")
|
||||
s.upload(Item('UID:xyzxyz'))
|
||||
item_file, = tmpdir.listdir()
|
||||
item_file.copy(item_file.new(basename=item_file.basename+'~'))
|
||||
ignorext = "~" # without dot
|
||||
|
||||
storage = self.storage_class(str(tmpdir), "", fileignoreext=ignorext)
|
||||
storage.upload(Item("UID:xyzxyz"))
|
||||
(item_file,) = tmpdir.listdir()
|
||||
item_file.copy(item_file.new(basename=item_file.basename + ignorext))
|
||||
|
||||
assert len(tmpdir.listdir()) == 2
|
||||
#assert False, tmpdir.listdir() # enable to see the created filename
|
||||
assert len(list(s.list())) == 1
|
||||
assert len(list(storage.list())) == 1
|
||||
|
||||
def test_too_long_uid(self, tmpdir):
|
||||
s = self.storage_class(str(tmpdir), ".txt")
|
||||
storage = self.storage_class(str(tmpdir), ".txt")
|
||||
item = Item("UID:" + "hue" * 600)
|
||||
href, etag = s.upload(item)
|
||||
|
||||
href, etag = storage.upload(item)
|
||||
assert item.uid not in href
|
||||
|
||||
def test_post_hook_inactive(self, tmpdir, monkeypatch):
|
||||
|
|
|
|||
Loading…
Reference in a new issue