tests/test_SMWApi.py
def checkExpected(self,ask,expectedRecords,debug=False):
        """ check that the given ask query returns the content of the expectedRecords""" 
        for smw in self.getSMWs('smwcopy'):
            result=self.getAskResult(smw,ask)
            if debug:
                print(result)
            self.assertEqual(len(expectedRecords),len(result))
            resultlist=list(result.items())
            for i in range(len(expectedRecords)):
                expectedRecord=expectedRecords[i]
                recordkey,record=resultlist[i];
                for key in expectedRecord.keys():
                    self.assertEquals(expectedRecord[key],record[key])
 check that the given ask query returns the content of the expectedRecords
check that the given ask query returns the content of the expectedRecords
check that the given ask query returns the content of the expectedRecords
def checkExpected(self,ask,expectedRecords,debug=False):
        for smw in self.getSMWs('smwcopy'):
            result=self.getAskResult(smw,ask)
            if debug:
                print(result)
            self.assertEqual(len(expectedRecords),len(result))
            resultlist=list(result.items())
            for i in range(len(expectedRecords)):
                expectedRecord=expectedRecords[i]
                recordkey,record=resultlist[i];
                for key in expectedRecord.keys():
                    self.assertEquals(expectedRecord[key],record[key])
def checkExpected ( self , ask , expectedRecords , debug = False ) : for smw in self . getSMWs ( 'smwcopy' ) : result = self . getAskResult ( smw , ask ) if debug : print ( result ) self . assertEqual ( len ( expectedRecords ) , len ( result ) ) resultlist = list ( result . items ( ) ) for i in range ( len ( expectedRecords ) ) : expectedRecord = expectedRecords [ i ] recordkey , record = resultlist [ i ] ; for key in expectedRecord . keys ( ) : self . assertEquals ( expectedRecord [ key ] , record [ key ] )
check that the given ask query returns the content of the expectedRecords
check that the given ask query returns the content of the expectedRecords
""" check that the given ask query returns the content of the expectedRecords"""
self
ask
expectedRecords
debug