11"""Integration tests for infrahubctl commands."""
22
3- import sys
43from unittest import mock
54
65import pytest
1312
1413runner = CliRunner ()
1514
16- requires_python_310 = pytest .mark .skipif (sys .version_info < (3 , 10 ), reason = "Requires Python 3.10 or higher" )
17-
1815
1916@pytest .fixture
2017def mock_client () -> mock .Mock :
@@ -29,7 +26,6 @@ def mock_client() -> mock.Mock:
2926class TestInfrahubctlRepository :
3027 """Groups the 'infrahubctl repository' test cases."""
3128
32- @requires_python_310
3329 @mock .patch ("infrahub_sdk.ctl.repository.initialize_client" )
3430 def test_repo_no_username_or_password (self , mock_init_client , mock_client ) -> None :
3531 """Case allow no username to be passed in and set it as None rather than blank string that fails."""
@@ -78,7 +74,6 @@ def test_repo_no_username_or_password(self, mock_init_client, mock_client) -> No
7874 tracker = "mutation-repository-create" ,
7975 )
8076
81- @requires_python_310
8277 @mock .patch ("infrahub_sdk.ctl.repository.initialize_client" )
8378 def test_repo_no_username (self , mock_init_client , mock_client ) -> None :
8479 """Case allow no username to be passed in and set it as None rather than blank string that fails."""
@@ -139,7 +134,6 @@ def test_repo_no_username(self, mock_init_client, mock_client) -> None:
139134 tracker = "mutation-repository-create" ,
140135 )
141136
142- @requires_python_310
143137 @mock .patch ("infrahub_sdk.ctl.repository.initialize_client" )
144138 def test_repo_username (self , mock_init_client , mock_client ) -> None :
145139 """Case allow no username to be passed in and set it as None rather than blank string that fails."""
@@ -202,7 +196,6 @@ def test_repo_username(self, mock_init_client, mock_client) -> None:
202196 tracker = "mutation-repository-create" ,
203197 )
204198
205- @requires_python_310
206199 @mock .patch ("infrahub_sdk.ctl.repository.initialize_client" )
207200 def test_repo_readonly_true (self , mock_init_client , mock_client ) -> None :
208201 """Case allow no username to be passed in and set it as None rather than blank string that fails."""
@@ -264,7 +257,6 @@ def test_repo_readonly_true(self, mock_init_client, mock_client) -> None:
264257 tracker = "mutation-repository-create" ,
265258 )
266259
267- @requires_python_310
268260 @mock .patch ("infrahub_sdk.ctl.repository.initialize_client" )
269261 def test_repo_description_commit_branch (self , mock_init_client , mock_client ) -> None :
270262 """Case allow no username to be passed in and set it as None rather than blank string that fails."""
@@ -333,9 +325,8 @@ def test_repo_description_commit_branch(self, mock_init_client, mock_client) ->
333325 tracker = "mutation-repository-create" ,
334326 )
335327
336- @requires_python_310
337- @mock .patch ("infrahub_sdk.ctl.repository.initialize_client" )
328+ # @mock.patch("infrahub_sdk.ctl.repository.initialize_client")
338329 def test_repo_list (self , mock_repositories_list ) -> None :
339330 result = runner .invoke (app , ["repository" , "list" , "--branch" , "main" ])
340- assert result .exit_code == 0
341331 assert strip_color (result .stdout ) == read_fixture ("output.txt" , "integration/test_infrahubctl/repository_list" )
332+ assert result .exit_code == 0
0 commit comments