@@ -44,6 +44,25 @@ def test_ident_with_slash(self, tmpdir):
44
44
(item_file ,) = tmpdir .listdir ()
45
45
assert "/" not in item_file .basename and item_file .isfile ()
46
46
47
+ def test_ignore_tmp_files (self , tmpdir ):
48
+ """Test that files with .tmp suffix beside .ics files are ignored."""
49
+ s = self .storage_class (str (tmpdir ), '.ics' )
50
+ s .upload (Item ('UID:xyzxyz' ))
51
+ item_file , = tmpdir .listdir ()
52
+ item_file .copy (item_file .new (ext = 'tmp' ))
53
+ assert len (tmpdir .listdir ()) == 2
54
+ assert len (list (s .list ())) == 1
55
+
56
+ def test_ignore_tmp_files_empty_fileext (self , tmpdir ):
57
+ """Test that files with .tmp suffix are ignored with empty fileext."""
58
+ s = self .storage_class (str (tmpdir ), '' )
59
+ s .upload (Item ('UID:xyzxyz' ))
60
+ item_file , = tmpdir .listdir ()
61
+ item_file .copy (item_file .new (ext = 'tmp' ))
62
+ assert len (tmpdir .listdir ()) == 2
63
+ # assert False, tmpdir.listdir() # enable to see the created filename
64
+ assert len (list (s .list ())) == 1
65
+
47
66
def test_too_long_uid (self , tmpdir ):
48
67
s = self .storage_class (str (tmpdir ), ".txt" )
49
68
item = Item ("UID:" + "hue" * 600 )
0 commit comments