update unittest test case
authorGuan Junchun <junchunx.guan@intel.com>
Tue, 27 Mar 2012 10:22:47 +0000 (18:22 +0800)
committerGuan Junchun <junchunx.guan@intel.com>
Tue, 27 Mar 2012 10:23:40 +0000 (18:23 +0800)
    1. test .tar.xz .tar.lzma .tgz is supported or not

tests/02_test_gbs_utils.py [new file with mode: 0644]
tests/test_gbs_utils.py [deleted file]

diff --git a/tests/02_test_gbs_utils.py b/tests/02_test_gbs_utils.py
new file mode 100644 (file)
index 0000000..d0889bd
--- /dev/null
@@ -0,0 +1,51 @@
+import unittest
+#import os
+from gitbuildsys import utils
+
+class TestUpsteramTarball(unittest.TestCase):
+    """test class UpstreamTarBall in utils"""
+
+    def setUp(self):
+        """Init a tarball base name"""
+        self.pkgname, self.version = ('OSC', '5.1.1')
+
+    def _testTarballFormat(self, postfix):
+        """test the sepecified tarball format is supported or not"""
+        obj = utils.UpstreamTarball(self.pkgname+'-'+self.version+postfix)
+        pkg, ver = obj.guess_version() or ('', '')
+        self.assertEqual(pkg, self.pkgname)
+        self.assertEqual(ver, self.version)
+
+    def testGZ(self):
+
+        self._testTarballFormat('.tar.gz')
+
+    def testBZ2(self):
+
+        self._testTarballFormat('.tar.bz2')
+
+    def testXZ(self):
+
+        self._testTarballFormat('.tar.xz')
+
+    def testLZMA(self):
+
+        self._testTarballFormat('.tar.lzma')
+
+    def testTizen(self):
+
+        self._testTarballFormat('-tizen.tar.bz2')
+        
+    def testZIP(self):
+
+        self._testTarballFormat('.zip')
+
+    def testTGZ(self):
+
+        self._testTarballFormat('.tgz')
+
+    def testNegative(self):
+
+        self._testTarballFormat('.orig.tar.gz')
+#if __name__ = '__main__'
+#    unittest.main()
diff --git a/tests/test_gbs_utils.py b/tests/test_gbs_utils.py
deleted file mode 100644 (file)
index 9a7ac9c..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-import unittest
-#import os
-from gitbuildsys import utils
-
-class TestUpsteramTarball(unittest.TestCase):
-    """test class UpstreamTarBall in utils"""
-
-    def setUp(self):
-        """Init a tarball base name"""
-        self.pkgname, self.version = ('osc-perm', '5.1.1')
-
-    def _testTarballFormat(self, postfix):
-        """test the sepecified tarball format is supported or not"""
-        obj = utils.UpstreamTarball(self.pkgname+'-'+self.version+postfix)
-        pkg, ver = obj.guess_version() or ('', '')
-        self.assertEqual(pkg, self.pkgname)
-        self.assertEqual(ver, self.version)
-
-    def testGZ(self):
-
-        self._testTarballFormat('.tar.gz')
-
-    def testBZ2(self):
-
-        self._testTarballFormat('.tar.bz2')
-
-    def testTizen(self):
-
-        self._testTarballFormat('-tizen.tar.bz2')
-        
-    def testZIP(self):
-
-        self._testTarballFormat('.zip')
-
-    def testTGZ(self):
-
-        self._testTarballFormat('.tgz')
-
-    def testNegative(self):
-
-        self._testTarballFormat('.src.rpm')
-        self._testTarballFormat('.orig.tar.gz')
-#if __name__ = '__main__'
-#    unittest.main()