Coverage for tests/conftest.py: 89%

19 statements  

« prev     ^ index     » next       coverage.py v7.15.3, created at 2026-08-04 18:15 +0000

1import pytest 

2 

3from pephubclient.pephub_oauth.models import InitializeDeviceCodeResponse 

4 

5 

6@pytest.fixture() 

7def device_code_return(): 

8 device_code = "asdf2345" 

9 return InitializeDeviceCodeResponse( 

10 device_code=device_code, 

11 auth_url=f"any_base_url/auth/device/login/{device_code}", 

12 ) 

13 

14 

15@pytest.fixture() 

16def test_raw_pep_return(): 

17 sample_prj = { 

18 "config": { 

19 "This": "is config", 

20 "description": "desc", 

21 "name": "sample name", 

22 }, 

23 "subsamples": [], 

24 "samples": [ 

25 {"time": "0", "file_path": "source1", "sample_name": "pig_0h"}, 

26 {"time": "1", "file_path": "source1", "sample_name": "pig_1h"}, 

27 {"time": "0", "file_path": "source1", "sample_name": "frog_0h"}, 

28 ], 

29 } 

30 return sample_prj 

31 

32 

33@pytest.fixture 

34def requests_get_mock(mocker): 

35 return mocker.patch("requests.get") 

36 

37 

38@pytest.fixture 

39def input_return_mock(monkeypatch): 

40 return monkeypatch.setattr("builtins.input", lambda: None) 

41 

42 

43@pytest.fixture 

44def test_jwt(): 

45 return ( 

46 "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9." 

47 "eyJsb2dpbiI6InJhZmFsc3RlcGllbiIsImlkIjo0MzkyNjUyMiwib3JnYW5pemF0aW9ucyI6bnVsbH0." 

48 "mgBP-7x5l9cqufhzdVi0OFA78pkYDEymwPFwud02BAc" 

49 )