1616import unittest
1717
1818from bandwidth .models .brtc_error_response import BrtcErrorResponse
19+ from bandwidth .models .brtc_error import BrtcError
20+ from bandwidth .models .brtc_link import BrtcLink
1921
2022class TestBrtcErrorResponse (unittest .TestCase ):
2123 """BrtcErrorResponse unit test stubs"""
@@ -31,59 +33,48 @@ def make_instance(self, include_optional) -> BrtcErrorResponse:
3133 include_optional is a boolean, when False only required
3234 params are included, when True both required and
3335 optional params are included """
34- # uncomment below to create an instance of `BrtcErrorResponse`
35- """
36- model = BrtcErrorResponse()
3736 if include_optional :
3837 return BrtcErrorResponse (
39- links = [
40- bandwidth.models.brtc_link.brtcLink(
41- href = 'https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
42- rel = 'self',
43- method = 'GET', )
44- ],
45- data = None,
46- errors = [
47- bandwidth.models.brtc_error.brtcError(
48- id = '59512d87-7a92-4040-8e4a-78fb772019b9',
49- type = 'resource.not_found',
50- description = 'The requested resource was not found.',
51- code = '404',
52- source = bandwidth.models.brtc_error_source.brtcErrorSource(
53- parameter = 'accountId',
54- field = 'accountId',
55- header = 'Authorization',
56- reference = 'e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', ), )
57- ]
38+ links = [
39+ BrtcLink (
40+ href = 'https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' ,
41+ rel = 'self' ,
42+ method = 'GET'
43+ )
44+ ],
45+ data = None ,
46+ errors = [
47+ BrtcError (
48+ id = '59512d87-7a92-4040-8e4a-78fb772019b9' ,
49+ type = 'resource.not_found' ,
50+ description = 'The requested resource was not found.' ,
51+ code = '404'
52+ )
53+ ]
5854 )
5955 else :
6056 return BrtcErrorResponse (
61- links = [
62- bandwidth.models.brtc_link.brtcLink(
63- href = 'https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
64- rel = 'self',
65- method = 'GET', )
66- ],
67- data = None,
68- errors = [
69- bandwidth.models.brtc_error.brtcError(
70- id = '59512d87-7a92-4040-8e4a-78fb772019b9',
71- type = 'resource.not_found',
72- description = 'The requested resource was not found.',
73- code = '404',
74- source = bandwidth.models.brtc_error_source.brtcErrorSource(
75- parameter = 'accountId',
76- field = 'accountId',
77- header = 'Authorization',
78- reference = 'e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', ), )
79- ],
80- )
81- """
57+ links = [],
58+ data = None ,
59+ errors = []
60+ )
8261
8362 def testBrtcErrorResponse (self ):
8463 """Test BrtcErrorResponse"""
85- # inst_req_only = self.make_instance(include_optional=False)
86- # inst_req_and_optional = self.make_instance(include_optional=True)
64+ instance = self .make_instance (True )
65+ assert instance is not None
66+ assert isinstance (instance , BrtcErrorResponse )
67+ assert isinstance (instance .links , list )
68+ assert len (instance .links ) == 1
69+ assert isinstance (instance .links [0 ], BrtcLink )
70+ assert instance .links [0 ].href == 'https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85'
71+ assert instance .links [0 ].rel == 'self'
72+ assert instance .data is None
73+ assert isinstance (instance .errors , list )
74+ assert len (instance .errors ) == 1
75+ assert isinstance (instance .errors [0 ], BrtcError )
76+ assert instance .errors [0 ].type == 'resource.not_found'
77+ assert instance .errors [0 ].description == 'The requested resource was not found.'
8778
8879if __name__ == '__main__' :
8980 unittest .main ()
0 commit comments