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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Wed Feb 9 09:10:52 CET 2011


Revision: 13240
          http://gar.svn.sourceforge.net/gar/?rev=13240&view=rev
Author:   wahwah
Date:     2011-02-09 08:10:52 +0000 (Wed, 09 Feb 2011)

Log Message:
-----------
checkpkg: Unit test for collection name verifier

This function determines whether a given string is a good name for
a collection of libraries.  Here are 3 tests for it.

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

Modified: csw/mgar/gar/v2/lib/python/sharedlib_utils_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/sharedlib_utils_test.py	2011-02-09 07:52:43 UTC (rev 13239)
+++ csw/mgar/gar/v2/lib/python/sharedlib_utils_test.py	2011-02-09 08:10:52 UTC (rev 13240)
@@ -263,6 +263,18 @@
     self.assertEqual(None, su.MakePackageNameBySonameCollection(sonames))
 
 
+class ValidateCollectionNameTest(unittest.TestCase):
+
+  def testLetters(self):
+    self.assertEqual(True, su.ValidateCollectionName("foo"))
+
+  def testOneLetter(self):
+    self.assertEqual(False, su.ValidateCollectionName("f"))
+
+  def testNoLetters(self):
+    self.assertEqual(False, su.ValidateCollectionName("-2.0"))
+
+
 class CommomSubstringTest(unittest.TestCase):
 
   def testLongestCommonSubstring_1(self):


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