[csw-devel] SF.net SVN: gar:[9435] csw/mgar/gar/v2/lib/python
wahwah at users.sourceforge.net
wahwah at users.sourceforge.net
Mon Mar 29 13:36:27 CEST 2010
Revision: 9435
http://gar.svn.sourceforge.net/gar/?rev=9435&view=rev
Author: wahwah
Date: 2010-03-29 11:36:26 +0000 (Mon, 29 Mar 2010)
Log Message:
-----------
mGAR v2: checkpkg, fixed a bug with overrides with colons.
Modified Paths:
--------------
csw/mgar/gar/v2/lib/python/checkpkg.py
csw/mgar/gar/v2/lib/python/checkpkg_test.py
Modified: csw/mgar/gar/v2/lib/python/checkpkg.py
===================================================================
--- csw/mgar/gar/v2/lib/python/checkpkg.py 2010-03-29 11:10:42 UTC (rev 9434)
+++ csw/mgar/gar/v2/lib/python/checkpkg.py 2010-03-29 11:36:26 UTC (rev 9435)
@@ -894,7 +894,7 @@
level_1 = line.split(":")
if len(level_1) > 1:
pkgname = level_1[0]
- data_1 = level_1[1]
+ data_1 = ":".join(level_1[1:])
else:
pkgname = None
data_1 = level_1[0]
Modified: csw/mgar/gar/v2/lib/python/checkpkg_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/checkpkg_test.py 2010-03-29 11:10:42 UTC (rev 9434)
+++ csw/mgar/gar/v2/lib/python/checkpkg_test.py 2010-03-29 11:36:26 UTC (rev 9435)
@@ -184,7 +184,7 @@
checkpkg.CheckpkgTag("CSWfoo", "foo-tag", "foo-info"),
],
}
- screen_report, tags_report = m.FormatReports(tags, [])
+ screen_report, tags_report = m.FormatReports(tags, [], [])
expected = u'# Tags reported by testname module\nCSWfoo: foo-tag foo-info\n'
self.assertEqual(expected, tags_report)
@@ -197,7 +197,7 @@
checkpkg.CheckpkgTag("CSWfoo", "baz-tag"),
],
}
- screen_report, tags_report = m.FormatReports(tags, [])
+ screen_report, tags_report = m.FormatReports(tags, [], [])
expected = (u'# Tags reported by testname module\n'
u'CSWfoo: foo-tag foo-info\n'
u'CSWfoo: bar-tag bar-info\n'
@@ -234,9 +234,13 @@
line1 = "CSWfoo: foo-override"
line2 = "CSWfoo: foo-override foo-info"
line3 = "CSWfoo: foo-override foo-info-1 foo-info-2"
+ line4 = ("CSWpmcommonsense: "
+ "pkginfo-description-not-starting-with-uppercase "
+ "common-sense: Some sane defaults for Perl programs")
self.o1 = checkpkg.ParseOverrideLine(line1)
self.o2 = checkpkg.ParseOverrideLine(line2)
self.o3 = checkpkg.ParseOverrideLine(line3)
+ self.o4 = checkpkg.ParseOverrideLine(line4)
def test_ParseOverridesLine1(self):
self.assertEqual("CSWfoo", self.o1.pkgname)
@@ -259,7 +263,20 @@
def test_ParseOverridesLine7(self):
self.assertEqual("foo-info-1 foo-info-2", self.o3.tag_info)
+ def test_ParseOverridesLine_4_1(self):
+ self.assertEqual("CSWpmcommonsense", self.o4.pkgname)
+ def test_ParseOverridesLine_4_2(self):
+ self.assertEqual(
+ "pkginfo-description-not-starting-with-uppercase",
+ self.o4.tag_name)
+
+ def test_ParseOverridesLine_4_3(self):
+ self.assertEqual(
+ "common-sense: Some sane defaults for Perl programs",
+ self.o4.tag_info)
+
+
class ApplyOverridesUnitTest(unittest.TestCase):
# This would be better, more terse. But requires metaclasses.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list