[csw-devel] SF.net SVN: gar:[14799] csw/mgar/gar/v2/lib/python

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Mon Jun 13 08:57:09 CEST 2011


Revision: 14799
          http://gar.svn.sourceforge.net/gar/?rev=14799&view=rev
Author:   wahwah
Date:     2011-06-13 06:57:09 +0000 (Mon, 13 Jun 2011)

Log Message:
-----------
file-set-checker: Fix a bug in the file name check

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/python/file_set_checker.py
    csw/mgar/gar/v2/lib/python/file_set_checker_test.py

Modified: csw/mgar/gar/v2/lib/python/file_set_checker.py
===================================================================
--- csw/mgar/gar/v2/lib/python/file_set_checker.py	2011-06-13 01:43:46 UTC (rev 14798)
+++ csw/mgar/gar/v2/lib/python/file_set_checker.py	2011-06-13 06:57:09 UTC (rev 14799)
@@ -32,7 +32,7 @@
   def _CheckFilenames(self, files_with_metadata):
     tags = []
     for filename, parsed_filename in files_with_metadata:
-      if not filename.endswith(".pkg.gz") or not filename.endswith(".pkg"):
+      if not filename.endswith(".pkg.gz") and not filename.endswith(".pkg"):
         tags.append(tag.CheckpkgTag(
           None,
           "bad-filename",

Modified: csw/mgar/gar/v2/lib/python/file_set_checker_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/file_set_checker_test.py	2011-06-13 01:43:46 UTC (rev 14798)
+++ csw/mgar/gar/v2/lib/python/file_set_checker_test.py	2011-06-13 06:57:09 UTC (rev 14799)
@@ -82,6 +82,13 @@
     files_with_metadata = fc._FilesWithMetadata(files)
     self.assertEqual(expected, fc._CheckFilenames(files_with_metadata))
 
+  def testFilenamesGood(self):
+    fc = file_set_checker.FileSetChecker()
+    files = ['/home/experimental/maciej/'
+             'nspr-4.8.6,REV=2010.10.16-SunOS5.9-all-CSW.pkg.gz']
+    files_with_metadata = fc._FilesWithMetadata(files)
+    self.assertEqual([], fc._CheckFilenames(files_with_metadata))
 
+
 if __name__ == '__main__':
 	unittest.main()


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