Fix RPM extract_version unittests 03/53803/4
authorDaniel Farrell <dfarrell@redhat.com>
Fri, 24 Mar 2017 17:13:09 +0000 (13:13 -0400)
committerJamo Luhrsen <jluhrsen@redhat.com>
Fri, 24 Mar 2017 21:12:15 +0000 (21:12 +0000)
Update to use current autorelease examples, fix PEP8 violation.

Change-Id: Iec782dddd9f86e1a3b672cf46c8d07709ea49fc7
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
rpm/test_build.py

index 60ac18e8d4b4e4a89bd73c835f40ffc92ac03d89..93c437992fd4227a06cd229eca0ce91d8e36c3a9 100644 (file)
@@ -22,7 +22,8 @@ class TestExtractVersion(unittest.TestCase):
 
     def test_beryllium_release_url(self):
         """Test URL of ODL Beryllium release."""
-        url = "%s/public/org/opendaylight/integration/distribution-karaf/0.4.0-Beryllium/distribution-karaf-0.4.0-Beryllium.tar.gz" %self.nexus_url  # noqa
+        # noqa ShellCheckBear
+        url = "%s/public/org/opendaylight/integration/distribution-karaf/0.4.0-Beryllium/distribution-karaf-0.4.0-Beryllium.tar.gz" % self.nexus_url
         version = build.extract_version(url)
         self.assertEqual(version["version_major"], "4")
         self.assertEqual(version["version_minor"], "0")
@@ -31,7 +32,8 @@ class TestExtractVersion(unittest.TestCase):
 
     def test_beryllium_sr4_release_url(self):
         """Test URL of ODL Beryllium SR4 release."""
-        url = "%s/opendaylight.release/org/opendaylight/integration/distribution-karaf/0.4.4-Beryllium-SR4/distribution-karaf-0.4.4-Beryllium-SR4.tar.gz" %self.nexus_url  # noqa
+        # noqa ShellCheckBear
+        url = "%s/opendaylight.release/org/opendaylight/integration/distribution-karaf/0.4.4-Beryllium-SR4/distribution-karaf-0.4.4-Beryllium-SR4.tar.gz" % self.nexus_url
         version = build.extract_version(url)
         self.assertEqual(version["version_major"], "4")
         self.assertEqual(version["version_minor"], "4")
@@ -40,7 +42,8 @@ class TestExtractVersion(unittest.TestCase):
 
     def test_boron_release_url(self):
         """Test URL of ODL Boron release."""
-        url = "%s/opendaylight.release/org/opendaylight/integration/distribution-karaf/0.5.0-Boron/distribution-karaf-0.5.0-Boron.tar.gz" %self.nexus_url  # noqa
+        # noqa ShellCheckBear
+        url = "%s/opendaylight.release/org/opendaylight/integration/distribution-karaf/0.5.0-Boron/distribution-karaf-0.5.0-Boron.tar.gz" % self.nexus_url
         version = build.extract_version(url)
         self.assertEqual(version["version_major"], "5")
         self.assertEqual(version["version_minor"], "0")
@@ -49,34 +52,39 @@ class TestExtractVersion(unittest.TestCase):
 
     def test_boron_sr1_release_url(self):
         """Test URL of ODL Boron SR1 release."""
-        url = "%s/opendaylight.release/org/opendaylight/integration/distribution-karaf/0.5.1-Boron-SR1/distribution-karaf-0.5.1-Boron-SR1.tar.gz" %self.nexus_url  # noqa
+        # noqa ShellCheckBear
+        url = "%s/opendaylight.release/org/opendaylight/integration/distribution-karaf/0.5.1-Boron-SR1/distribution-karaf-0.5.1-Boron-SR1.tar.gz" % self.nexus_url
         version = build.extract_version(url)
         self.assertEqual(version["version_major"], "5")
         self.assertEqual(version["version_minor"], "1")
         self.assertEqual(version["version_patch"], "0")
         self.assertEqual(version["rpm_release"], "1")
 
-    def test_boron_sr2_autorelease_url(self):
-        """Test URL of ODL Boron SR2 autorelease."""
-        url = "%s/autorelease-1599/org/opendaylight/integration/distribution-karaf/0.5.2-Boron-SR2/distribution-karaf-0.5.2-Boron-SR2.tar.gz" %self.nexus_url  # noqa
+    def test_boron_sr3_autorelease_url(self):
+        """Test URL of ODL Boron SR3 autorelease."""
+        # noqa ShellCheckBear
+        url = "%s/autorelease-1734/org/opendaylight/integration/distribution-karaf/0.5.3-Boron-SR3/distribution-karaf-0.5.3-Boron-SR3.tar.gz" % self.nexus_url
         version = build.extract_version(url)
         self.assertEqual(version["version_major"], "5")
-        self.assertEqual(version["version_minor"], "2")
+        self.assertEqual(version["version_minor"], "3")
         self.assertEqual(version["version_patch"], "0")
-        self.assertEqual(version["rpm_release"], "0.1.20161211rel1599")
+        self.assertEqual(version["rpm_release"], "0.1.20170324rel1734")
 
+    @unittest.skip("No current Carbon autorelease examples")
     def test_carbon_autorelease_url(self):
         """Test URL of ODL Carbon autorelease."""
-        url = "%s/autorelease-1582/org/opendaylight/integration/distribution-karaf/0.6.0-Carbon/distribution-karaf-0.6.0-Carbon.tar.gz" %self.nexus_url  # noqa
+        # noqa ShellCheckBear
+        url = "%s/autorelease-1582/org/opendaylight/integration/distribution-karaf/0.6.0-Carbon/distribution-karaf-0.6.0-Carbon.tar.gz" % self.nexus_url
         version = build.extract_version(url)
         self.assertEqual(version["version_major"], "6")
         self.assertEqual(version["version_minor"], "0")
         self.assertEqual(version["version_patch"], "0")
         self.assertEqual(version["rpm_release"], "0.1.20161117rel1582")
 
-    def test_boron_snapshot_url(self):
+    def test_boron_sr2_snapshot_url(self):
         """Test URL of ODL Boron SR2 snapshot."""
-        url = "%s/opendaylight.snapshot/org/opendaylight/integration/distribution-karaf/0.5.2-SNAPSHOT/distribution-karaf-0.5.2-20161212.010649-530.tar.gz" %self.nexus_url  # noqa
+        # noqa ShellCheckBear
+        url = "%s/opendaylight.snapshot/org/opendaylight/integration/distribution-karaf/0.5.2-SNAPSHOT/distribution-karaf-0.5.2-20161212.010649-530.tar.gz" % self.nexus_url
         version = build.extract_version(url)
         self.assertEqual(version["version_major"], "5")
         self.assertEqual(version["version_minor"], "2")
@@ -85,7 +93,8 @@ class TestExtractVersion(unittest.TestCase):
 
     def test_carbon_snapshot_url(self):
         """Test URL of ODL Carbon snapshot."""
-        url = "%s/opendaylight.snapshot/org/opendaylight/integration/distribution-karaf/0.6.0-SNAPSHOT/distribution-karaf-0.6.0-20161212.173815-2486.tar.gz" %self.nexus_url  # noqa
+        # noqa ShellCheckBear
+        url = "%s/opendaylight.snapshot/org/opendaylight/integration/distribution-karaf/0.6.0-SNAPSHOT/distribution-karaf-0.6.0-20161212.173815-2486.tar.gz" % self.nexus_url
         version = build.extract_version(url)
         self.assertEqual(version["version_major"], "6")
         self.assertEqual(version["version_minor"], "0")