|
1 | 1 | import time |
2 | 2 | from unittest import TestCase, mock |
3 | 3 |
|
4 | | -from openhexa.cli.api import _detect_graphql_breaking_changes, graphql |
| 4 | +from openhexa.cli.openhexa_client import _detect_graphql_breaking_changes, graphql |
5 | 5 |
|
6 | 6 |
|
7 | 7 | class TestGraphQLFunctions(TestCase): |
8 | | - @mock.patch("openhexa.cli.api._query_graphql") |
9 | | - @mock.patch("openhexa.cli.api.get_library_versions") |
| 8 | + @mock.patch("openhexa.cli.openhexa_client._query_graphql") |
| 9 | + @mock.patch("openhexa.cli.openhexa_client.get_library_versions") |
10 | 10 | def test_detect_graphql_breaking_changes_with_mocked_server_schema( |
11 | 11 | self, mock_get_library_versions, mock_query_graphql |
12 | 12 | ): |
@@ -53,11 +53,11 @@ def test_detect_graphql_breaking_changes_with_mocked_server_schema( |
53 | 53 | ) |
54 | 54 | mock_click_secho.assert_any_call("- Query.testField changed type from Int to String.", fg="yellow") |
55 | 55 |
|
56 | | - @mock.patch("openhexa.cli.api._query_graphql") |
57 | | - @mock.patch("openhexa.cli.api._detect_graphql_breaking_changes") |
| 56 | + @mock.patch("openhexa.cli.openhexa_client._query_graphql") |
| 57 | + @mock.patch("openhexa.cli.openhexa_client._detect_graphql_breaking_changes") |
58 | 58 | def test_graphql(self, mock_detect_graphql_breaking_changes, mock_query_graphql): |
59 | 59 | """Test that the graphql function is caching the breaking change detection for 1 hour.""" |
60 | | - with mock.patch("openhexa.cli.api.settings") as mock_settings: |
| 60 | + with mock.patch("openhexa.cli.openhexa_client.settings") as mock_settings: |
61 | 61 | mock_settings.last_breaking_change_check = time.time() - 59 * 60 # Last checked 59 minutes ago |
62 | 62 | mock_query_graphql.return_value = {"data": "response"} |
63 | 63 |
|
|
0 commit comments