summaryrefslogtreecommitdiff
path: root/tests/test_find_top_level.py
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2017-11-14 16:09:29 +0100
committerMichał Górny <mgorny@gentoo.org>2017-11-14 16:34:31 +0100
commit487e4a5e566afc68f35f4a012fcd492256ac4d93 (patch)
tree99ee3cf302f8700f83df4f831568e7bd804a0444 /tests/test_find_top_level.py
parentc6d3264ebc9876ebfea4d3e15ee8d39a12aff22a (diff)
downloadgemato-487e4a5e566afc68f35f4a012fcd492256ac4d93.tar.gz
find_top_level: Disallow compressed top-level Manifest by default
Diffstat (limited to 'tests/test_find_top_level.py')
-rw-r--r--tests/test_find_top_level.py28
1 files changed, 20 insertions, 8 deletions
diff --git a/tests/test_find_top_level.py b/tests/test_find_top_level.py
index 2218799..5e20453 100644
--- a/tests/test_find_top_level.py
+++ b/tests/test_find_top_level.py
@@ -207,10 +207,15 @@ class TestCompressedManifest(TempDirTestCase):
with gzip.GzipFile(os.path.join(self.dir, 'subc/sub/Manifest.gz'), 'wb'):
pass
+ def test_find_top_level_manifest_no_allow_compressed(self):
+ self.assertIsNone(
+ gemato.find_top_level.find_top_level_manifest(self.dir))
+
def test_find_top_level_manifest(self):
self.assertEqual(
os.path.relpath(
- gemato.find_top_level.find_top_level_manifest(self.dir),
+ gemato.find_top_level.find_top_level_manifest(
+ self.dir, allow_compressed=True),
self.dir),
'Manifest.gz')
@@ -218,7 +223,8 @@ class TestCompressedManifest(TempDirTestCase):
self.assertEqual(
os.path.relpath(
gemato.find_top_level.find_top_level_manifest(
- os.path.join(self.dir, 'suba')),
+ os.path.join(self.dir, 'suba'),
+ allow_compressed=True),
self.dir),
'Manifest.gz')
@@ -226,7 +232,8 @@ class TestCompressedManifest(TempDirTestCase):
self.assertEqual(
os.path.relpath(
gemato.find_top_level.find_top_level_manifest(
- os.path.join(self.dir, 'subb')),
+ os.path.join(self.dir, 'subb'),
+ allow_compressed=True),
self.dir),
'Manifest.gz')
@@ -234,7 +241,8 @@ class TestCompressedManifest(TempDirTestCase):
self.assertEqual(
os.path.relpath(
gemato.find_top_level.find_top_level_manifest(
- os.path.join(self.dir, 'subc', 'sub')),
+ os.path.join(self.dir, 'subc', 'sub'),
+ allow_compressed=True),
self.dir),
'Manifest.gz')
@@ -256,20 +264,23 @@ class TestCompressedManifestWithIgnore(TempDirTestCase):
def test_find_top_level_manifest(self):
self.assertEqual(
os.path.relpath(
- gemato.find_top_level.find_top_level_manifest(self.dir),
+ gemato.find_top_level.find_top_level_manifest(
+ self.dir, allow_compressed=True),
self.dir),
'Manifest.gz')
def test_find_top_level_manifest_from_ignored_empty_subdir(self):
self.assertIsNone(
gemato.find_top_level.find_top_level_manifest(
- os.path.join(self.dir, 'suba')))
+ os.path.join(self.dir, 'suba'),
+ allow_compressed=True))
def test_find_top_level_manifest_from_manifest_subdir(self):
self.assertEqual(
os.path.relpath(
gemato.find_top_level.find_top_level_manifest(
- os.path.join(self.dir, 'subb')),
+ os.path.join(self.dir, 'subb'),
+ allow_compressed=True),
self.dir),
'Manifest.gz')
@@ -277,6 +288,7 @@ class TestCompressedManifestWithIgnore(TempDirTestCase):
self.assertEqual(
os.path.relpath(
gemato.find_top_level.find_top_level_manifest(
- os.path.join(self.dir, 'subc', 'sub')),
+ os.path.join(self.dir, 'subc', 'sub'),
+ allow_compressed=True),
self.dir),
'subc/sub/Manifest.gz')