summaryrefslogtreecommitdiff
path: root/tests/test_recursiveloader.py
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2018-02-02 18:48:58 +0100
committerMichał Górny <mgorny@gentoo.org>2018-02-02 18:48:58 +0100
commit42eb2bbd5bbc0fe63df3fc73dee94f8df5ea988b (patch)
treed0913bb278096ffc13c4056d63eb083c9107bafb /tests/test_recursiveloader.py
parent7d8518f0af961cbfdcfa22c9e35a9233965ecd0a (diff)
downloadgemato-42eb2bbd5bbc0fe63df3fc73dee94f8df5ea988b.tar.gz
recursiveloader: Check for cross-device directories earlier in loop
Check for cross-device directory when starting to process the directory rather than for each subdirectory to be processed. This will avoid double stat() call in the future. It also means that cross-device exceptions are raised a little later, when recurring into the directory rather than before doing that. However, the starting directory is now also tested.
Diffstat (limited to 'tests/test_recursiveloader.py')
-rw-r--r--tests/test_recursiveloader.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_recursiveloader.py b/tests/test_recursiveloader.py
index 4a5662f..94002d2 100644
--- a/tests/test_recursiveloader.py
+++ b/tests/test_recursiveloader.py
@@ -1564,6 +1564,12 @@ DATA sub/version 0 MD5 d41d8cd98f00b204e9800998ecf8427e
m.assert_directory_verifies, '',
fail_handler=callback_return_true)
+ def test_assert_directory_verifies_subdir(self):
+ m = gemato.recursiveloader.ManifestRecursiveLoader(
+ os.path.join(self.dir, 'Manifest'))
+ self.assertRaises(gemato.exceptions.ManifestCrossDevice,
+ m.assert_directory_verifies, 'sub')
+
def test_cli_verifies(self):
self.assertEqual(
gemato.cli.main(['gemato', 'verify', self.dir]),