2020# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121# SOFTWARE.
2222
23+ import pytest
24+
2325from typing import Dict
2426from flask .testing import FlaskClient
2527
2628from resource_api_client import ResourceAPIClient
2729
2830
2931def test_create (client : FlaskClient , oidc_token_write : Dict ):
32+ if oidc_token_write is None :
33+ pytest .skip ('No OIDC configuration is available' )
3034 rac = ResourceAPIClient (client , token = oidc_token_write )
3135 (resp , resp_body ) = rac .create (name = 'Test Resource 1' )
3236 assert resp .status_code == 201
@@ -36,6 +40,8 @@ def test_create(client: FlaskClient, oidc_token_write: Dict):
3640
3741
3842def test_modify (client : FlaskClient , oidc_token_write ):
43+ if oidc_token_write is None :
44+ pytest .skip ('No OIDC configuration is available' )
3945 rac = ResourceAPIClient (client , token = oidc_token_write )
4046
4147 (resp , resp_body ) = rac .create (name = 'Test Resource Original' )
@@ -52,6 +58,8 @@ def test_modify(client: FlaskClient, oidc_token_write):
5258
5359
5460def test_remove (client : FlaskClient , oidc_token_write ):
61+ if oidc_token_write is None :
62+ pytest .skip ('No OIDC configuration is available' )
5563 rac = ResourceAPIClient (client , token = oidc_token_write )
5664 (resp , resp_body ) = rac .create (name = 'Short-lived Test Resource' )
5765 assert resp .status_code == 201
@@ -63,6 +71,8 @@ def test_remove(client: FlaskClient, oidc_token_write):
6371
6472
6573def test_get_all (client : FlaskClient , oidc_token_read , oidc_token_write ):
74+ if oidc_token_read is None or oidc_token_write is None :
75+ pytest .skip ('No OIDC configuration is available' )
6676 rac_read = ResourceAPIClient (client , token = oidc_token_read )
6777 rac_write = ResourceAPIClient (client , token = oidc_token_write )
6878
@@ -81,6 +91,8 @@ def test_get_all(client: FlaskClient, oidc_token_read, oidc_token_write):
8191
8292
8393def test_get_one (client : FlaskClient , oidc_token_read , oidc_token_write ):
94+ if oidc_token_read is None or oidc_token_write is None :
95+ pytest .skip ('No OIDC configuration is available' )
8496 rac_read = ResourceAPIClient (client , token = oidc_token_read )
8597 rac_write = ResourceAPIClient (client , token = oidc_token_write )
8698
0 commit comments