1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

Changeset 8507

Show
Ignore:
Timestamp:
02/11/10 23:58:44 (4 years ago)
Author:
wahwah
Message:

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

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • csw/mgar/gar/v2/tests/overrides_test.py

    r8480 r8507  
    1010  """Tests CHECKPKG_OVERRIDES support.""" 
    1111 
    12   def testPkginfoName(self): 
    13     """Checks that the GARNAME makes it to the NAME in pkginfo.""" 
     12  def testOneOverride(self): 
     13    """Checks that CHECKPKG_OVERRIDES variable creates an override.""" 
    1414    mybuild = gartest.DynamicGarBuild() 
    1515    mybuild.SetGarVariable("GARNAME", "overrides-test") 
    1616    mybuild.SetGarVariable("CATALOGNAME", "overrides_test") 
    17     mybuild.SetGarVariable("CHECKPKG_OVERRIDES", "CSWoverrides-test|example-tag|example-parameter") 
     17    mybuild.SetGarVariable("CHECKPKG_OVERRIDES", 
     18                           "CSWoverrides-test|example-tag|example-parameter") 
    1819    mybuild.WriteGarFiles() 
    1920    self.assertEquals(0, mybuild.Build()) 
     
    2425    overrides = pkg.GetOverrides() 
    2526    self.assertEqual(1, len(overrides)) 
     27 
     28  def testTwoOverriders(self): 
     29    """Checks that CHECKPKG_OVERRIDES variable creates overrides.""" 
     30    mybuild = gartest.DynamicGarBuild() 
     31    mybuild.SetGarVariable("GARNAME", "overrides-test") 
     32    mybuild.SetGarVariable("CATALOGNAME", "overrides_test") 
     33    mybuild.SetGarVariable( 
     34        "CHECKPKG_OVERRIDES", 
     35        ("CSWoverrides-test|example-tag-1|example-parameter-1 " 
     36         "CSWoverrides-test|example-tag-2|example-parameter-2")) 
     37    mybuild.WriteGarFiles() 
     38    self.assertEquals(0, mybuild.Build()) 
     39    pkg = mybuild.GetFirstBuiltPackage() 
     40    overr_file = "/opt/csw/share/checkpkg/overrides/overrides_test" 
     41    expected = ('CSWoverrides-test: example-tag-1 example-parameter-1\n' 
     42                'CSWoverrides-test: example-tag-2 example-parameter-2\n') 
     43    self.assertEqual(expected, pkg.GetFileContent(overr_file)) 
     44    overrides = pkg.GetOverrides() 
     45    self.assertEqual(2, len(overrides))