コード例 #1
0
 def testMaximumMaximumRecords(self):
     component = SruParser('host', 'port', maximumMaximumRecords=100)
     try:
         component.parseSruArgs({'version':['1.1'], 'query':['twente'], 'operation':['searchRetrieve'], 'maximumRecords': ['101']})
         self.fail()
     except SruException, e:
         self.assertEquals(UNSUPPORTED_PARAMETER_VALUE, [e.code, e.message])
コード例 #2
0
 def assertValid(self, expectedResult, arguments):
     component = SruParser('host', 'port')
     try:
         operation, arguments = component._parseArguments(arguments)
         if operation == "searchRetrieve":
             component.parseSruArgs(arguments)
         if expectedResult != SUCCESS:
             self.fail("Expected %s but got nothing"  % expectedResult)
     except SruException, e:
         self.assertEquals(expectedResult, [e.code, e.message])
コード例 #3
0
 def assertValid(self, expectedResult, arguments):
     component = SruParser('host', 'port')
     try:
         operation, arguments = component._parseArguments(arguments)
         if operation == "searchRetrieve":
             component.parseSruArgs(arguments)
         if expectedResult != SUCCESS:
             self.fail("Expected %s but got nothing" % expectedResult)
     except SruException as e:
         self.assertEqual(expectedResult, [e.code, e.message])
コード例 #4
0
 def testMaximumMaximumRecords(self):
     component = SruParser('host', 'port', maximumMaximumRecords=100)
     try:
         component.parseSruArgs({
             'version': ['1.1'],
             'query': ['twente'],
             'operation': ['searchRetrieve'],
             'maximumRecords': ['101']
         })
         self.fail()
     except SruException as e:
         self.assertEqual(UNSUPPORTED_PARAMETER_VALUE, [e.code, e.message])