Browse Source

Fix issue with test suite and empty dirs on git

Git doesn't save empty dirs, so put a placeholder there that is
ignored when the test data is copied to its final location during
testing.
tags/nilmdb-2.1.0
Jim Paris 1 year ago
parent
commit
10b34f5937
6 changed files with 8 additions and 1 deletions
  1. +1
    -0
      tests/fsck-data/test1/data/git-empty-dir-placeholder
  2. +1
    -0
      tests/fsck-data/test1a/data/git-empty-dir-placeholder
  3. +1
    -0
      tests/fsck-data/test1c/data/git-empty-dir-placeholder
  4. +1
    -0
      tests/fsck-data/test2h/data/git-empty-dir-placeholder
  5. +1
    -0
      tests/fsck-data/test2p/data/a/b/0001/git-empty-dir-placeholder
  6. +3
    -1
      tests/test_fsck.py

+ 1
- 0
tests/fsck-data/test1/data/git-empty-dir-placeholder View File

@@ -0,0 +1 @@
hi

+ 1
- 0
tests/fsck-data/test1a/data/git-empty-dir-placeholder View File

@@ -0,0 +1 @@
hi

+ 1
- 0
tests/fsck-data/test1c/data/git-empty-dir-placeholder View File

@@ -0,0 +1 @@
hi

+ 1
- 0
tests/fsck-data/test2h/data/git-empty-dir-placeholder View File

@@ -0,0 +1 @@
hi

+ 1
- 0
tests/fsck-data/test2p/data/a/b/0001/git-empty-dir-placeholder View File

@@ -0,0 +1 @@
hi

+ 3
- 1
tests/test_fsck.py View File

@@ -18,7 +18,9 @@ class TestFsck(object):
"""
if db is not None:
recursive_unlink("tests/fsck-testdb")
shutil.copytree(f"tests/fsck-data/{db}", "tests/fsck-testdb")
shutil.copytree(f"tests/fsck-data/{db}", "tests/fsck-testdb",
ignore=shutil.ignore_patterns(
"git-empty-dir-placeholder"))
class stdio_wrapper:
def __init__(self, stdin, stdout, stderr):
self.io = (stdin, stdout, stderr)


Loading…
Cancel
Save