MCPcopy
hub / github.com/spaceandtimefdn/SxT-Python-SDK / test_sxt_exceptions

Function test_sxt_exceptions

tests/test_spaceandtime.py:50–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48
49
50def test_sxt_exceptions():
51 mylogger.info(f'\n\ntest_sxt_exceptions\n{"-"*30}')
52 # test common exceptions
53 sxt = SpaceAndTime()
54 sxt.user.user_id = sxt.user.api_key = ''
55 with pytest.raises(Exception) as e_info: sxt.authenticate()
56
57 sxt = SpaceAndTime()
58 sxt.user.private_key = sxt.user.api_key = ''
59 with pytest.raises(Exception) as e_info: sxt.authenticate()
60
61 with pytest.raises(SxTAuthenticationError) as errinfo: raise SxTAuthenticationError('test message: SxTAuthenticationError')
62 with pytest.raises(SxTQueryError) as errinfo: raise SxTQueryError('test message: SxTQueryError')
63 with pytest.raises(SxTFileContentError) as errinfo: raise SxTFileContentError('test message: SxTFileContentError')
64 with pytest.raises(SxTArgumentError) as errinfo: raise SxTArgumentError('test message: SxTArgumentError')
65 with pytest.raises(SxTKeyEncodingError) as errinfo: raise SxTKeyEncodingError('test message: SxTKeyEncodingError')
66 with pytest.raises(SxTBiscuitError) as errinfo: raise SxTBiscuitError('test message: SxTBiscuitError')
67 with pytest.raises(SxTAPINotDefinedError) as errinfo: raise SxTAPINotDefinedError('test message: SxTAPINotDefinedError')
68 with pytest.raises(SxTAPINotSuccessfulError) as errinfo: raise SxTAPINotSuccessfulError('test message: SxTAPINotSuccessfulError')
69
70
71def test_sxt_wrapper():

Callers

nothing calls this directly

Calls 10

authenticateMethod · 0.95
SpaceAndTimeClass · 0.90
SxTQueryErrorClass · 0.85
SxTFileContentErrorClass · 0.85
SxTArgumentErrorClass · 0.85
SxTKeyEncodingErrorClass · 0.85
SxTBiscuitErrorClass · 0.85

Tested by

no test coverage detected