Skip to content

Commit f87861b

Browse files
committed
Add tests
Signed-off-by: Cristian Le <git@lecris.dev>
1 parent da9293a commit f87861b

File tree

6 files changed

+2239
-0
lines changed

6 files changed

+2239
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright Contributors to the Packit project.
2+
# SPDX-License-Identifier: MIT
3+
4+
from requre.online_replacing import record_requests_for_all_methods
5+
6+
from tests.integration.github.base import GithubTests
7+
8+
9+
@record_requests_for_all_methods()
10+
class Commit(GithubTests):
11+
def test_get_branch_commit(self):
12+
branch_commit = self.hello_world_project.get_commit("test-for-flock")
13+
assert branch_commit.sha.startswith("e2282f3")
14+
15+
def test_get_relative_commit(self):
16+
main_branch_commit = self.hello_world_project.get_commit("test-for-flock^^")
17+
assert main_branch_commit.sha.startswith("7c85553")
18+
merge_branch_commit = self.hello_world_project.get_commit("test-for-flock^^2")
19+
assert merge_branch_commit.sha.startswith("aa4883c")
20+
21+
def test_changes(self):
22+
commit = self.hello_world_project.get_commit("f06fed9")
23+
changes = commit.changes
24+
assert list(changes.files) == ["LICENSE", "README.md"]

0 commit comments

Comments
 (0)