def test_product_detail_firefox_beta(self):
     with mock.patch('time.strftime') as t:
         t.return_value = "2014-09-06"
         updateProductDetailFiles(self.targetSVNDirectory, "firefox", "33.0b12")
         self.ContentCheckfile(os.path.join(self.targetSVNDirectory, "LATEST_FIREFOX_DEVEL_VERSION.php"), "'33.0b12'")
         self.ContentCheckfile(os.path.join(self.targetSVNDirectory, "LATEST_FIREFOX_RELEASED_DEVEL_VERSION.php"), "'33.0b12'")
         self.ContentCheckfile(os.path.join(self.targetSVNDirectory, "history/firefoxHistory.class.php"), "'33.0b12' => '2014-09-06',")
    def test_product_detail_firefox_esr(self):
        with mock.patch('time.strftime') as t:
            t.return_value = "2014-09-11"

            updateProductDetailFiles(self.targetSVNDirectory, "firefox", "51.1.0esr")
            self.ContentCheckfile(os.path.join(self.targetSVNDirectory, "FIREFOX_ESR.php"), "'51.1.0esr'")
            self.ContentCheckfile(os.path.join(self.targetSVNDirectory, "history/firefoxHistory.class.php"), "'51.1.0' => '2014-09-11',")
    def test_product_detail_thunderbird_release(self):
        with mock.patch('time.strftime') as t:
            t.return_value = "2014-09-10"

            updateProductDetailFiles(self.targetSVNDirectory, "thunderbird", "33.0")
            self.ContentCheckfile(os.path.join(self.targetSVNDirectory, "LATEST_THUNDERBIRD_VERSION.php"), "'33.0'")
            self.ContentCheckfile(os.path.join(self.targetSVNDirectory, "history/thunderbirdHistory.class.php"), "'33.0' => '2014-09-10',")
            updateProductDetailFiles(self.targetSVNDirectory, "thunderbird", "34.0.2")
            self.ContentCheckfile(os.path.join(self.targetSVNDirectory, "LATEST_THUNDERBIRD_VERSION.php"), "'34.0.2'")
            self.ContentCheckfile(os.path.join(self.targetSVNDirectory, "history/thunderbirdHistory.class.php"), "'34.0.2' => '2014-09-10',")
    def test_product_detail_fennec_release(self):
        with mock.patch('time.strftime') as t:
            t.return_value = "2014-09-07"

            updateProductDetailFiles(self.targetSVNDirectory, "mobile", "32.0")
            self.ContentCheckfile(os.path.join(self.targetSVNDirectory, "mobile_latest_version.php"), "'32.0'")
            self.ContentCheckfile(os.path.join(self.targetSVNDirectory, "history/mobileHistory.class.php"), "'32.0' => '2014-09-07',")
            updateProductDetailFiles(self.targetSVNDirectory, "mobile", "31.0.1")
            self.ContentCheckfile(os.path.join(self.targetSVNDirectory, "mobile_latest_version.php"), "'31.0.1'")
            self.ContentCheckfile(os.path.join(self.targetSVNDirectory, "history/mobileHistory.class.php"), "'31.0.1' => '2014-09-07',")
Example #5
0
def updateProductDetails(productName, version, productDetailsRepo, mozillaComRepo, svnSshKey, dryRun=False):
    """
    Add a new version to the product details
    """
    os.environ["SVN_SSH"] = "ssh -i %s" % svnSshKey
    pdDir = "product-details.svn"
    mcDir = "mozilla.com.svn"
    retry(checkoutSVN, args=(pdDir, productDetailsRepo), attempts=3)
    retry(checkoutSVN, args=(mcDir, mozillaComRepo), attempts=3)
    # Update the PHP files
    updateProductDetailFiles(pdDir, productName, version)
    # Export to json
    exportJSON(pdDir)
    # Commit to svn
    commitSVN(pdDir, productName, version, dryRun)
    # Get the svn revision of the p-d repository
    svnRev = getSVNrev(pdDir)
    # Update Mozilla.com
    updateRev(mcDir, svnRev)
    # commit Mozilla.com
    commitSVN(pdDir, productName, version, dryRun)
 def test_product_detail_fennec_beta(self):
     with mock.patch('time.strftime') as t:
         t.return_value = "2014-09-05"
         updateProductDetailFiles(self.targetSVNDirectory, "mobile", "32.0b3")
         self.ContentCheckfile(os.path.join(self.targetSVNDirectory, "mobile_beta_version.php"), "'32.0b3'")
         self.ContentCheckfile(os.path.join(self.targetSVNDirectory, "history/mobileHistory.class.php"), "'32.0b3' => '2014-09-05',")
 def test_product_detail_firefox_aurora(self):
     updateProductDetailFiles(self.targetSVNDirectory, "firefox", "43.0a2")
     self.ContentCheckfile(os.path.join(self.targetSVNDirectory, "FIREFOX_AURORA.php"), "'43.0a2'")
 def test_product_detail_fennec_aurora(self):
     updateProductDetailFiles(self.targetSVNDirectory, "mobile", "42.0a2")
     self.ContentCheckfile(os.path.join(self.targetSVNDirectory, "mobile_alpha_version.php"), "'42.0a2'")