示例#1
0
 def test_tag_contributors(self, mock_fetch):
     with patch("pygit2.Mailmap"):
         v2_tag = GitTags(MagicMock()).get('v2')
         self.assertDictEqual({
             'Author1': 2,
             'Author2': 1
         }, v2_tag.contributors['commits_count'].to_dict())
示例#2
0
    def test_tag_tagger(self, mock_fetch):
        with patch("pygit2.Mailmap"):
            tags = GitTags(MagicMock()).all()
            unreleased_tag = next(tags)
            self.assertIsNone(unreleased_tag.tagger)

            v2_tag = next(tags)
            self.assertEqual("Release Master", v2_tag.tagger)
示例#3
0
 def test_tag_timings(self, mock_fetch):
     with patch("pygit2.Mailmap"):
         v2_tag = GitTags(MagicMock()).get('v2')
         self.assertEqual(
             datetime.datetime.utcfromtimestamp(1234).replace(
                 tzinfo=datetime.timezone.utc), v2_tag.created)
         self.assertEqual(
             datetime.datetime.utcfromtimestamp(14).replace(
                 tzinfo=datetime.timezone.utc), v2_tag.initiated)
示例#4
0
 def test_unreleased_tag_accessible(self, mock_fetch):
     with patch("pygit2.Mailmap"):
         tags = GitTags(MagicMock()).all()
         unreleased_tag = next(tags)
         self.assertEqual('unreleased', str(unreleased_tag))
示例#5
0
 def test_tag_commits_count(self, mock_fetch):
     with patch("pygit2.Mailmap"):
         v2_tag = GitTags(MagicMock()).get('v2')
         self.assertEqual(3, v2_tag.commits_count)
示例#6
0
 def test_tags_all(self, mock_fetch):
     with patch("pygit2.Mailmap"):
         tags = GitTags(MagicMock()).all()
         self.assertEqual(2, len(list(tags)))
示例#7
0
 def test_repo_with_no_tags(self, mock_fetch):
     with patch("pygit2.Mailmap"):
         tags = GitTags(MagicMock()).all()
         unreleased_tag = next(tags)
         self.assertIsNone(unreleased_tag.tagger)
         self.assertIsNone(unreleased_tag.created)