| |
@@ -0,0 +1,37 @@
|
| |
+ import os
|
| |
+ import unittest
|
| |
+
|
| |
+ from pyrpkg.layout import layouts
|
| |
+ from pyrpkg import errors
|
| |
+
|
| |
+
|
| |
+ fixtures_dir = os.path.join(os.path.dirname(__file__), 'fixtures')
|
| |
+
|
| |
+
|
| |
+ class IncompleteLayoutTestCase(unittest.TestCase):
|
| |
+ def setUp(self):
|
| |
+ self.workdir = os.path.join(fixtures_dir, 'layouts/incomplete-package')
|
| |
+ self.layout = layouts.IncompleteLayout.from_path(self.workdir)
|
| |
+
|
| |
+ def test_layout_data(self):
|
| |
+ self.assertEqual(self.layout.sourcedir, None)
|
| |
+ self.assertEqual(self.layout.specdir, None)
|
| |
+ self.assertEqual(self.layout.specdir, None)
|
| |
+ self.assertEqual(self.layout.root_dir, self.workdir)
|
| |
+ self.assertEqual(self.layout.builddir, None)
|
| |
+ self.assertEqual(self.layout.rpmdir, None)
|
| |
+ self.assertEqual(self.layout.srcrpmdir, None)
|
| |
+ self.assertEqual(self.layout.sources_file_template, 'sources')
|
| |
+
|
| |
+ def test_layout_not_retired(self):
|
| |
+ self.assertEqual(None, self.layout.is_retired())
|
| |
+
|
| |
+
|
| |
+ class IncompleteLayoutErrorsTestCase(unittest.TestCase):
|
| |
+ def setUp(self):
|
| |
+ self.workdir = os.path.join(fixtures_dir, 'layouts')
|
| |
+
|
| |
+ def test_path_error(self):
|
| |
+ with self.assertRaises(errors.LayoutError) as e:
|
| |
+ layouts.IncompleteLayout.from_path(os.path.join(self.workdir, 'notfound'))
|
| |
+ self.assertEqual('package path does not exist', e.exception.args[0])
|
| |
Some packages are missing some files that are essential for other
layouts. For example specfile(s). Rpkg detects these packages
and assigns the layout to them. It allows 'retire' command for these
packages.
JIRA: RHELCMP-2682
Resolves: rhbz#1885771
Signed-off-by: Ondrej Nosek onosek@redhat.com