File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -58,12 +58,25 @@ def _repo(
58
58
)
59
59
60
60
61
- def test_constuctor ():
62
- r = _repo (github = "github.com" , github_api = "api.github.com" )
61
+ @patch ("tagbot.action.repo.Github" )
62
+ def test_constructor (mock_github ):
63
+ # Mock the Github instance and its get_repo method
64
+ mock_gh_instance = Mock ()
65
+ mock_github .return_value = mock_gh_instance
66
+ mock_gh_instance .get_repo .return_value = Mock () # Mock registry repo
67
+
68
+ r = _repo (
69
+ github = "github.com" , github_api = "api.github.com" , registry = "test/registry"
70
+ )
63
71
assert r ._gh_url == "https://github.com"
64
72
assert r ._gh_api == "https://api.github.com"
65
73
assert r ._git ._github == "github.com"
66
- r = _repo (github = "https://github.com" , github_api = "https://api.github.com" )
74
+
75
+ r = _repo (
76
+ github = "https://github.com" ,
77
+ github_api = "https://api.github.com" ,
78
+ registry = "test/registry" ,
79
+ )
67
80
assert r ._gh_url == "https://github.com"
68
81
assert r ._gh_api == "https://api.github.com"
69
82
assert r ._git ._github == "github.com"
You can’t perform that action at this time.
0 commit comments