diff options
author | Anas Nashif <anas.nashif@intel.com> | 2012-11-21 15:28:00 -0800 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2012-11-21 15:28:00 -0800 |
commit | ec6268183d43997c7fe124ca40a877edb0d7555b (patch) | |
tree | eb871af5b189b33b9bdbb18fc7fd77d40b0e8c8f /test/test.SpecCheck.py | |
download | rpmlint-ec6268183d43997c7fe124ca40a877edb0d7555b.tar.gz rpmlint-ec6268183d43997c7fe124ca40a877edb0d7555b.tar.bz2 rpmlint-ec6268183d43997c7fe124ca40a877edb0d7555b.zip |
Imported Upstream version 1.4upstream/1.4
Diffstat (limited to 'test/test.SpecCheck.py')
-rw-r--r-- | test/test.SpecCheck.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/test.SpecCheck.py b/test/test.SpecCheck.py new file mode 100644 index 0000000..fadf970 --- /dev/null +++ b/test/test.SpecCheck.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- + +import re +import unittest +import Testing +import SpecCheck + +class TestSpecCheck(unittest.TestCase): + def setUp(self): + self.pkg = Testing.getTestedSpecPackage('SpecCheck') + Testing.startTest() + def testcheck(self): + SpecCheck.check.check_spec(self.pkg, self.pkg.name) + out = "\n".join(Testing.getOutput()) + self.assertTrue("patch-not-applied Patch3" in out) + self.assertFalse(re.search("patch-not-applied Patch\\b", out)) + self.assertFalse(re.search("patch-not-applied Patch[01245]", out)) + self.assertTrue("libdir-macro-in-noarch-package" not in out) + self.assertTrue(len(re.findall("macro-in-comment", out)) == 1) + self.assertTrue("unversioned-explicit-provides unversioned-provides" + in out) + self.assertTrue("unversioned-explicit-provides versioned-provides" + not in out) + self.assertTrue("unversioned-explicit-obsoletes unversioned-obsoletes" + in out) + self.assertTrue("unversioned-explicit-obsoletes versioned-obsoletes" + not in out) + +if __name__ == '__main__': + unittest.main() |