Patchwork [bitbake-devel] tests/utils: Add test for explode_dep_versions2

login
register
mail settings
Submitter Richard Purdie
Date Oct. 2, 2012, 12:08 a.m.
Message ID <1349136509.15753.123.camel@ted>
Download mbox | patch
Permalink /patch/37577/
State New
Headers show

Comments

Richard Purdie - Oct. 2, 2012, 12:08 a.m.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---

Patch

diff --git a/bitbake/lib/bb/tests/utils.py b/bitbake/lib/bb/tests/utils.py
index 04e8d5d..9f60491 100644
--- a/bitbake/lib/bb/tests/utils.py
+++ b/bitbake/lib/bb/tests/utils.py
@@ -34,3 +34,18 @@  class VerCmpString(unittest.TestCase):
         result = bb.utils.vercmp_string('1.1', '1_p2')
         self.assertTrue(result < 0)
 
+    def test_explode_dep_versions(self):
+        correctresult = {"foo" : ["= 1.10"]}
+        result = bb.utils.explode_dep_versions2("foo (= 1.10)")
+        self.assertEqual(result, correctresult)
+        result = bb.utils.explode_dep_versions2("foo (=1.10)")
+        self.assertEqual(result, correctresult)
+        result = bb.utils.explode_dep_versions2("foo ( = 1.10)")
+        self.assertEqual(result, correctresult)
+        result = bb.utils.explode_dep_versions2("foo ( =1.10)")
+        self.assertEqual(result, correctresult)
+        result = bb.utils.explode_dep_versions2("foo ( = 1.10 )")
+        self.assertEqual(result, correctresult)
+        result = bb.utils.explode_dep_versions2("foo ( =1.10 )")
+        self.assertEqual(result, correctresult)
+