Ejemplo n.º 1
0
    def testGetLatestVersion(self):
        """Tests the GetLatestVersion functions."""
        download_helper_object = download_helper.GitHubReleasesDownloadHelper(
            self._DOWNLOAD_URL)

        latest_version = download_helper_object.GetLatestVersion(
            self._PROJECT_NAME, None)

        self.assertEqual(latest_version, self._PROJECT_VERSION)
Ejemplo n.º 2
0
    def testGetProjectIdentifier(self):
        """Tests the GetProjectIdentifier functions."""
        download_helper_object = download_helper.GitHubReleasesDownloadHelper(
            self._DOWNLOAD_URL)

        project_identifier = download_helper_object.GetProjectIdentifier()

        expected_project_identifier = 'com.github.{0:s}.{1:s}'.format(
            self._PROJECT_ORGANIZATION, self._PROJECT_NAME)

        self.assertEqual(project_identifier, expected_project_identifier)
Ejemplo n.º 3
0
    def testGetDownloadURL(self):
        """Tests the GetDownloadURL functions."""
        download_helper_object = download_helper.GitHubReleasesDownloadHelper(
            self._DOWNLOAD_URL)

        download_url = download_helper_object.GetDownloadURL(
            self._PROJECT_NAME, self._PROJECT_VERSION)

        expected_download_url = (
            'https://github.com/{0:s}/{1:s}/archive/{2:s}.tar.gz').format(
                self._PROJECT_ORGANIZATION, self._PROJECT_NAME,
                self._PROJECT_VERSION)

        self.assertEqual(download_url, expected_download_url)