コード例 #1
0
 def test_AbstractRequest_getUriPathAndOptions(self, sessionUrl, dc,
                                               uriBase, requestType):
     expected = '.' + requestType
     session = LoginSession(sessionUrl, 'admin', 'password',
                            requestFormat=requestType)
     ar = AbstractRequest()
     if dc is not None:
         ar.id =  dc
         expected += '?_dc=' + dc
     if uriBase is None:
         uriBase = ''
     ar.uriBase = uriBase
     expected = uriBase + expected
     assert ar.getUriPathAndOptions(session) == expected
コード例 #2
0
ファイル: test_request.py プロジェクト: bischatt78/cobra
 def test_AbstractRequest_getUriPathAndOptions(self, sessionUrl, dc,
                                               uriBase, requestType):
     expected = '.' + requestType
     session = LoginSession(sessionUrl, 'admin', 'password',
                            requestFormat=requestType)
     ar = AbstractRequest()
     if dc is not None:
         ar.id =  dc
         expected += '?_dc=' + dc
     if uriBase is None:
         uriBase = ''
     ar.uriBase = uriBase
     expected = uriBase + expected
     assert ar.getUriPathAndOptions(session) == expected
コード例 #3
0
 def test_AbstractRequest_makeOptions(self, optionsDict, expected1,
                                      expected2):
     options = AbstractRequest.makeOptions(optionsDict)
     assert (options == expected1 or options == expected2)
コード例 #4
0
 def test_AbstractRequest_options_property(self, value, expected):
     ar = AbstractRequest()
     ar.id = value
     assert ar.options == expected
コード例 #5
0
 def test_AbstractRequest_individual_properties(self, prop, value):
     ar = AbstractRequest()
     setattr(ar, prop, value)
     assert getattr(ar, prop) == value
コード例 #6
0
 def test_AbstractRequest_init(self):
     assert isinstance(AbstractRequest(), AbstractRequest)
コード例 #7
0
ファイル: test_request.py プロジェクト: bischatt78/cobra
 def test_AbstractRequest_makeOptions(self, optionsDict, expected1,
                                      expected2):
     options = AbstractRequest.makeOptions(optionsDict)
     assert (options == expected1 or options == expected2)
コード例 #8
0
ファイル: test_request.py プロジェクト: bischatt78/cobra
 def test_AbstractRequest_options_property(self, value, expected):
     ar = AbstractRequest()
     ar.id = value
     assert ar.options == expected