bitbake: test/fetch: Split the network tests from the rest of the fetcher tests
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 17 May 2013 08:46:47 +0000 (11:46 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 17 May 2013 09:42:08 +0000 (12:42 +0300)
(Bitbake rev: f32265bcc6b4fe5566aca16f6b05555ec6a96d01)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/tests/fetch.py

index 8bf095c..a56d7da 100644 (file)
@@ -252,7 +252,7 @@ class URITest(unittest.TestCase):
             self.assertEqual(str(uri), (str(uri).split(";"))[0])
 
 
-class FetcherTest(unittest.TestCase):
+class FetcherUriTest(unittest.TestCase):
 
     replaceuris = {
         ("git://git.invalid.infradead.org/mtd-utils.git;tag=1234567890123456789012345678901234567890", "git://.*/.*", "http://somewhere.org/somedir/") 
@@ -294,6 +294,29 @@ class FetcherTest(unittest.TestCase):
                 "https://.*/.* file:///someotherpath/downloads/ \n" \
                 "http://.*/.* file:///someotherpath/downloads/ \n"
 
+    def test_urireplace(self):
+        for k, v in self.replaceuris.items():
+            ud = bb.fetch.FetchData(k[0], self.d)
+            ud.setup_localpath(self.d)
+            mirrors = bb.fetch2.mirror_from_string("%s %s" % (k[1], k[2]))
+            newuris, uds = bb.fetch2.build_mirroruris(ud, mirrors, self.d)
+            self.assertEqual([v], newuris)
+
+    def test_urilist1(self):
+        fetcher = bb.fetch.FetchData("http://downloads.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz", self.d)
+        mirrors = bb.fetch2.mirror_from_string(self.mirrorvar)
+        uris, uds = bb.fetch2.build_mirroruris(fetcher, mirrors, self.d)
+        self.assertEqual(uris, ['file:///somepath/downloads/bitbake-1.0.tar.gz', 'file:///someotherpath/downloads/bitbake-1.0.tar.gz'])
+
+    def test_urilist2(self):
+        # Catch https:// -> files:// bug
+        fetcher = bb.fetch.FetchData("https://downloads.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz", self.d)
+        mirrors = bb.fetch2.mirror_from_string(self.mirrorvar)
+        uris, uds = bb.fetch2.build_mirroruris(fetcher, mirrors, self.d)
+        self.assertEqual(uris, ['file:///someotherpath/downloads/bitbake-1.0.tar.gz'])
+
+class FetcherTest(unittest.TestCase):
+
     def setUp(self):
         self.d = bb.data.init()
         self.tempdir = tempfile.mkdtemp()
@@ -389,28 +412,6 @@ class FetcherTest(unittest.TestCase):
         self.d.setVar("PREMIRRORS", "%s git://%s;protocol=file \n" % (dummyurl, self.sourcedir))
         self.gitfetcher(dummyurl, dummyurl)
 
-    def test_urireplace(self):
-        for k, v in self.replaceuris.items():
-            ud = bb.fetch.FetchData(k[0], self.d)
-            ud.setup_localpath(self.d)
-            mirrors = bb.fetch2.mirror_from_string("%s %s" % (k[1], k[2]))
-            newuris, uds = bb.fetch2.build_mirroruris(ud, mirrors, self.d)
-            self.assertEqual([v], newuris)
-
-    def test_urilist1(self):
-        fetcher = bb.fetch.FetchData("http://downloads.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz", self.d)
-        mirrors = bb.fetch2.mirror_from_string(self.mirrorvar)
-        uris, uds = bb.fetch2.build_mirroruris(fetcher, mirrors, self.d)
-        self.assertEqual(uris, ['file:///somepath/downloads/bitbake-1.0.tar.gz', 'file:///someotherpath/downloads/bitbake-1.0.tar.gz'])
-
-    def test_urilist2(self):
-        # Catch https:// -> files:// bug
-        fetcher = bb.fetch.FetchData("https://downloads.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz", self.d)
-        mirrors = bb.fetch2.mirror_from_string(self.mirrorvar)
-        uris, uds = bb.fetch2.build_mirroruris(fetcher, mirrors, self.d)
-        self.assertEqual(uris, ['file:///someotherpath/downloads/bitbake-1.0.tar.gz'])
-
-
 class URLHandle(unittest.TestCase):
 
     datatable = {