Coverage for tests/cli_test.py: 100%

13 statements  

« prev     ^ index     » next       coverage.py v7.6.10, created at 2025-01-09 16:45 +0100

1import subprocess 

2import time 

3 

4import requests 

5 

6 

7def test_cli(): 

8 with subprocess.Popen( 

9 ["oidc-provider-mock"], 

10 stdin=None, 

11 text=True, 

12 ) as process: 

13 try: 

14 time.sleep(0.5) 

15 base_url = "http://127.0.0.1:9000" 

16 response = requests.get(f"{base_url}/.well-known/openid-configuration") 

17 assert response.status_code == 200 

18 body = response.json() 

19 assert body["issuer"] == base_url 

20 finally: 

21 process.terminate()