Exemple #1
0
    def test_get_author_null(self, mocked_gql: Any) -> None:
        """ Tests that PR author can be computed
            If reply contains NULL
        """
        pr = GitHubPR("pytorch", "pytorch", 71759)
        author = pr.get_author()
        self.assertTrue(author is not None)
        self.assertTrue("@" in author)
        self.assertTrue(pr.get_diff_revision() is None)

        # PR with multiple contributors, but creator id is not among authors
        pr = GitHubPR("pytorch", "pytorch", 75095)
        self.assertEqual(pr.get_pr_creator_login(), "mruberry")
        author = pr.get_author()
        self.assertTrue(author is not None)
Exemple #2
0
 def test_get_author_many_commits(self, mocked_gql: Any) -> None:
     """ Tests that authors for all commits can be fetched
     """
     pr = GitHubPR("pytorch", "pytorch", 76118)
     authors = pr.get_authors()
     self.assertGreater(pr.get_commit_count(), 100)
     self.assertGreater(len(authors), 50)
     self.assertTrue("@" in pr.get_author())
Exemple #3
0
 def test_get_author_null(self, mocked_gql: Any) -> None:
     """ Tests that PR author can be computed
         If reply contains NULL
     """
     pr = GitHubPR("pytorch", "pytorch", 71759)
     author = pr.get_author()
     self.assertTrue(author is not None)
     self.assertTrue("@" in author)