Exemplo n.º 1
0
 def test_invalid_token(self):
     """
     Test invalid GitHub personal access token.
     """
     with self.assertRaises(ghstats.GithubTokenError):
         ghstats.download_stats("kefir500", "foobar", None, False, "FOOBAR",
                                True)
Exemplo n.º 2
0
 def test_invalid_repo(self):
     """
     Test nonexistent repository.
     """
     with self.assertRaises(ghstats.GithubRepoError):
         ghstats.download_stats("kefir500", "foobar", None, False,
                                ghstats.get_env_token(), True)
Exemplo n.º 3
0
 def test_release(self):
     """
     Test statistics for the latest release.
     """
     stats = ghstats.download_stats("kefir500", "apk-icon-editor", None, True, ghstats.get_env_token(), False)
     self.assertTrue(isinstance(stats, dict))
     count = ghstats.get_stats_downloads(stats, False)
     self.assertTrue(count > 0)
Exemplo n.º 4
0
 def test_unicode(self):
     """
     Test Unicode handling.
     """
     release = ghstats.download_stats("d3", "d3", "v3.5.0", False, ghstats.get_env_token(), False)
     try:
         ghstats.get_release_downloads(release)
     except UnicodeEncodeError:
         self.fail("Could not handle Unicode release statistics.")
Exemplo n.º 5
0
 def test_release(self):
     """
     Test statistics for the latest release.
     """
     stats = ghstats.download_stats("kefir500", "apk-icon-editor", None,
                                    True, ghstats.get_env_token(), False)
     self.assertTrue(isinstance(stats, dict))
     count = ghstats.get_stats_downloads(stats, False)
     self.assertTrue(count > 0)
Exemplo n.º 6
0
 def test_unicode(self):
     """
     Test Unicode handling.
     """
     release = ghstats.download_stats("d3", "d3", "v3.5.0", False,
                                      ghstats.get_env_token(), False)
     try:
         ghstats.get_release_downloads(release)
     except UnicodeEncodeError:
         self.fail("Could not handle Unicode release statistics.")
Exemplo n.º 7
0
 def test_invalid_token(self):
     """
     Test invalid GitHub personal access token.
     """
     with self.assertRaises(ghstats.GithubTokenError):
         ghstats.download_stats("kefir500", "foobar", None, False, "FOOBAR", True)
Exemplo n.º 8
0
 def test_invalid_repo(self):
     """
     Test nonexistent repository.
     """
     with self.assertRaises(ghstats.GithubRepoError):
         ghstats.download_stats("kefir500", "foobar", None, False, ghstats.get_env_token(), True)