mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-25 08:55:50 +00:00
Improve storage/test_filesystem
with one additional test and fixing of the documentation.
This commit is contained in:
parent
81895c291e
commit
9b5e01ab38
2 changed files with 13 additions and 2 deletions
|
|
@ -408,7 +408,7 @@ Local
|
|||
fileext = "..."
|
||||
#encoding = "utf-8"
|
||||
#post_hook = null
|
||||
#fileextignore = ".tmp"
|
||||
#fileignoreext = ".tmp"
|
||||
|
||||
Can be used with `khal <http://lostpackets.de/khal/>`_. See :doc:`vdir` for
|
||||
a more formal description of the format.
|
||||
|
|
@ -427,7 +427,7 @@ Local
|
|||
:param post_hook: A command to call for each item creation and
|
||||
modification. The command will be called with the path of the
|
||||
new/updated file.
|
||||
:param fileextignore: The file extention to ignore,
|
||||
:param fileeignoreext: The file extention to ignore,
|
||||
the default is ``.tmp``.
|
||||
|
||||
.. storage:: singlefile
|
||||
|
|
|
|||
|
|
@ -63,6 +63,17 @@ class TestFilesystemStorage(StorageTests):
|
|||
# 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+'~'))
|
||||
assert len(tmpdir.listdir()) == 2
|
||||
#assert False, tmpdir.listdir() # enable to see the created filename
|
||||
assert len(list(s.list())) == 1
|
||||
|
||||
def test_too_long_uid(self, tmpdir):
|
||||
s = self.storage_class(str(tmpdir), ".txt")
|
||||
item = Item("UID:" + "hue" * 600)
|
||||
|
|
|
|||
Loading…
Reference in a new issue