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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Tue Dec 21 11:35:06 CET 2010


Revision: 12061
          http://gar.svn.sourceforge.net/gar/?rev=12061&view=rev
Author:   wahwah
Date:     2010-12-21 10:35:05 +0000 (Tue, 21 Dec 2010)

Log Message:
-----------
checkpkg: Version string parser unit tests

Adding a unit test to show the use of small rev.

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

Modified: csw/mgar/gar/v2/lib/python/opencsw_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/opencsw_test.py	2010-12-21 10:34:33 UTC (rev 12060)
+++ csw/mgar/gar/v2/lib/python/opencsw_test.py	2010-12-21 10:35:05 UTC (rev 12061)
@@ -207,13 +207,26 @@
 
   def test_Text(self):
     data = "That, sir, is a frab-rication! It's wabbit season!"
-    opencsw.ParseVersionString(data)
+    # Make sure that we don't crash and return a tuple.  No guarantees
+    # for the content.
+    self.assertEquals(tuple, type(opencsw.ParseVersionString(data)))
 
   def test_Empty(self):
     data = ""
     expected = ('', {'major version': ''}, {})
     self.assertEqual(expected, opencsw.ParseVersionString(data))
 
+  def testSmallRev(self):
+    data = "4.7.25,REV=2009.10.18_rev=p4"
+    expected = (
+        '4.7.25',
+        {'minor version': '7',
+         'patchlevel': '25',
+         'major version': '4'},
+        {'rev': 'p4',
+         'REV': '2009.10.18'})
+    self.assertEqual(expected, opencsw.ParseVersionString(data))
+
   def testExtraStringsHashable(self):
     data = "2.7,REV=2009.06.18_STABLE6"
     expected = (


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