@@ -1467,6 +1467,7 @@ async def mock_branches_list_query(httpx_mock: HTTPXMock) -> HTTPXMock:
14671467 method = "POST" ,
14681468 json = response ,
14691469 match_headers = {"X-Infrahub-Tracker" : "query-branch-all" },
1470+ is_reusable = True ,
14701471 )
14711472 return httpx_mock
14721473
@@ -1599,8 +1600,8 @@ async def mock_repositories_query(httpx_mock: HTTPXMock) -> HTTPXMock:
15991600 }
16001601 }
16011602
1602- httpx_mock .add_response (method = "POST" , url = "http://mock/graphql/main" , json = response1 )
1603- httpx_mock .add_response (method = "POST" , url = "http://mock/graphql/cr1234" , json = response2 )
1603+ httpx_mock .add_response (method = "POST" , url = "http://mock/graphql/main" , json = response1 , is_reusable = True )
1604+ httpx_mock .add_response (method = "POST" , url = "http://mock/graphql/cr1234" , json = response2 , is_reusable = True )
16041605 return httpx_mock
16051606
16061607
@@ -1640,6 +1641,7 @@ async def mock_query_repository_page1_1(
16401641 method = "POST" ,
16411642 json = response ,
16421643 match_headers = {"X-Infrahub-Tracker" : "query-corerepository-page1" },
1644+ is_reusable = True ,
16431645 )
16441646 return httpx_mock
16451647
@@ -1743,6 +1745,7 @@ async def mock_query_repository_page1_2(
17431745 method = "POST" ,
17441746 json = response ,
17451747 match_headers = {"X-Infrahub-Tracker" : "query-corerepository-page1" },
1748+ is_reusable = True ,
17461749 )
17471750 return httpx_mock
17481751
@@ -1783,6 +1786,7 @@ async def mock_query_repository_page2_2(
17831786 method = "POST" ,
17841787 json = response ,
17851788 match_headers = {"X-Infrahub-Tracker" : "query-corerepository-page2" },
1789+ is_reusable = True ,
17861790 )
17871791 return httpx_mock
17881792
@@ -1795,6 +1799,7 @@ async def mock_schema_query_01(httpx_mock: HTTPXMock) -> HTTPXMock:
17951799 method = "GET" ,
17961800 url = "http://mock/api/schema?branch=main" ,
17971801 json = ujson .loads (response_text ),
1802+ is_reusable = True ,
17981803 )
17991804 return httpx_mock
18001805
@@ -1803,7 +1808,10 @@ async def mock_schema_query_01(httpx_mock: HTTPXMock) -> HTTPXMock:
18031808async def mock_schema_query_02 (httpx_mock : HTTPXMock ) -> HTTPXMock :
18041809 response_text = (get_fixtures_dir () / "schema_02.json" ).read_text (encoding = "UTF-8" )
18051810 httpx_mock .add_response (
1806- method = "GET" , url = re .compile (r"^http://mock/api/schema\?branch=(main|cr1234)" ), json = ujson .loads (response_text )
1811+ method = "GET" ,
1812+ url = re .compile (r"^http://mock/api/schema\?branch=(main|cr1234)" ),
1813+ json = ujson .loads (response_text ),
1814+ is_reusable = True ,
18071815 )
18081816 return httpx_mock
18091817
@@ -2141,14 +2149,14 @@ async def mock_query_mutation_location_create_failed(httpx_mock: HTTPXMock) -> H
21412149
21422150@pytest .fixture
21432151async def mock_query_infrahub_version (httpx_mock : HTTPXMock ) -> HTTPXMock :
2144- httpx_mock .add_response (method = "POST" , json = {"data" : {"InfrahubInfo" : {"version" : "1.1.0" }}})
2152+ httpx_mock .add_response (method = "POST" , json = {"data" : {"InfrahubInfo" : {"version" : "1.1.0" }}}, is_reusable = True )
21452153 return httpx_mock
21462154
21472155
21482156@pytest .fixture
21492157async def mock_query_infrahub_user (httpx_mock : HTTPXMock ) -> HTTPXMock :
21502158 response_text = (get_fixtures_dir () / "account_profile.json" ).read_text (encoding = "UTF-8" )
2151- httpx_mock .add_response (method = "POST" , json = ujson .loads (response_text ))
2159+ httpx_mock .add_response (method = "POST" , json = ujson .loads (response_text ), is_reusable = True )
21522160 return httpx_mock
21532161
21542162
@@ -2492,7 +2500,7 @@ async def mock_query_location_batch_count(
24922500 httpx_mock : HTTPXMock , client : InfrahubClient , mock_schema_query_01
24932501) -> HTTPXMock :
24942502 response = {"data" : {"BuiltinLocation" : {"count" : 30 }}}
2495- httpx_mock .add_response (method = "POST" , url = "http://mock/graphql/main" , json = response )
2503+ httpx_mock .add_response (method = "POST" , url = "http://mock/graphql/main" , json = response , is_reusable = True )
24962504 return httpx_mock
24972505
24982506
@@ -2505,6 +2513,7 @@ async def mock_query_location_batch(httpx_mock: HTTPXMock, client: InfrahubClien
25052513 method = "POST" ,
25062514 json = ujson .loads (response_text ),
25072515 match_headers = {"X-Infrahub-Tracker" : f"query-builtinlocation-page{ i } " },
2516+ is_reusable = True ,
25082517 )
25092518 return httpx_mock
25102519
0 commit comments