[csw-devel] SF.net SVN: gar:[8507] csw/mgar/gar/v2/tests/overrides_test.py

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Fri Feb 12 00:58:44 CET 2010


Revision: 8507
          http://gar.svn.sourceforge.net/gar/?rev=8507&view=rev
Author:   wahwah
Date:     2010-02-11 23:58:44 +0000 (Thu, 11 Feb 2010)

Log Message:
-----------
mGAR v2: checkpkg, added a test case for two overrides

Modified Paths:
--------------
    csw/mgar/gar/v2/tests/overrides_test.py

Modified: csw/mgar/gar/v2/tests/overrides_test.py
===================================================================
--- csw/mgar/gar/v2/tests/overrides_test.py	2010-02-11 18:43:27 UTC (rev 8506)
+++ csw/mgar/gar/v2/tests/overrides_test.py	2010-02-11 23:58:44 UTC (rev 8507)
@@ -9,12 +9,13 @@
 class OverridesUnitTest(unittest.TestCase):
   """Tests CHECKPKG_OVERRIDES support."""
 
-  def testPkginfoName(self):
-    """Checks that the GARNAME makes it to the NAME in pkginfo."""
+  def testOneOverride(self):
+    """Checks that CHECKPKG_OVERRIDES variable creates an override."""
     mybuild = gartest.DynamicGarBuild()
     mybuild.SetGarVariable("GARNAME", "overrides-test")
     mybuild.SetGarVariable("CATALOGNAME", "overrides_test")
-    mybuild.SetGarVariable("CHECKPKG_OVERRIDES", "CSWoverrides-test|example-tag|example-parameter")
+    mybuild.SetGarVariable("CHECKPKG_OVERRIDES",
+                           "CSWoverrides-test|example-tag|example-parameter")
     mybuild.WriteGarFiles()
     self.assertEquals(0, mybuild.Build())
     pkg = mybuild.GetFirstBuiltPackage()
@@ -23,3 +24,22 @@
     self.assertEqual(expected, pkg.GetFileContent(overr_file))
     overrides = pkg.GetOverrides()
     self.assertEqual(1, len(overrides))
+
+  def testTwoOverriders(self):
+    """Checks that CHECKPKG_OVERRIDES variable creates overrides."""
+    mybuild = gartest.DynamicGarBuild()
+    mybuild.SetGarVariable("GARNAME", "overrides-test")
+    mybuild.SetGarVariable("CATALOGNAME", "overrides_test")
+    mybuild.SetGarVariable(
+        "CHECKPKG_OVERRIDES",
+        ("CSWoverrides-test|example-tag-1|example-parameter-1 "
+         "CSWoverrides-test|example-tag-2|example-parameter-2"))
+    mybuild.WriteGarFiles()
+    self.assertEquals(0, mybuild.Build())
+    pkg = mybuild.GetFirstBuiltPackage()
+    overr_file = "/opt/csw/share/checkpkg/overrides/overrides_test"
+    expected = ('CSWoverrides-test: example-tag-1 example-parameter-1\n'
+                'CSWoverrides-test: example-tag-2 example-parameter-2\n')
+    self.assertEqual(expected, pkg.GetFileContent(overr_file))
+    overrides = pkg.GetOverrides()
+    self.assertEqual(2, len(overrides))


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