|
6 | 6 | import random |
7 | 7 |
|
8 | 8 | import pytest |
9 | | -from mock_vws import MockVWS, States |
| 9 | +from mock_vws import MockVWS |
| 10 | +from mock_vws.database import VuforiaDatabase |
| 11 | +from mock_vws.states import States |
10 | 12 | from PIL import Image |
11 | 13 | from requests import codes |
12 | 14 |
|
@@ -97,10 +99,10 @@ def test_fail(high_quality_image: io.BytesIO) -> None: |
97 | 99 | """ |
98 | 100 | A ``Fail`` exception is raised when there are authentication issues. |
99 | 101 | """ |
100 | | - with MockVWS() as mock: |
| 102 | + with MockVWS(): |
101 | 103 | client = VWS( |
102 | 104 | server_access_key='a', |
103 | | - server_secret_key=mock.server_secret_key, |
| 105 | + server_secret_key='a', |
104 | 106 | ) |
105 | 107 |
|
106 | 108 | with pytest.raises(Fail) as exc: |
@@ -144,10 +146,12 @@ def test_project_inactive(client: VWS, high_quality_image: io.BytesIO) -> None: |
144 | 146 | A ``ProjectInactive`` exception is raised if adding a target to an |
145 | 147 | inactive database. |
146 | 148 | """ |
147 | | - with MockVWS(state=States.PROJECT_INACTIVE) as mock: |
| 149 | + database = VuforiaDatabase(state=States.PROJECT_INACTIVE) |
| 150 | + with MockVWS() as mock: |
| 151 | + mock.add_database(database=database) |
148 | 152 | client = VWS( |
149 | | - server_access_key=mock.server_access_key, |
150 | | - server_secret_key=mock.server_secret_key, |
| 153 | + server_access_key=database.server_access_key.decode(), |
| 154 | + server_secret_key=database.server_secret_key.decode(), |
151 | 155 | ) |
152 | 156 |
|
153 | 157 | with pytest.raises(ProjectInactive) as exc: |
|
0 commit comments