Tests_Python.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:IM_Climate 作者: IMDProjects 项目源码 文件源码
def confirmContent(self):
        '''
        Confirms that all information is the same, ignoring record order
        '''
        dr = StationDataRequestor()
        wxData =  dr.getMonthlyWxSummaryByYear(climateStations =  self.climateStations,
            climateParameters = self.climateParameters, reduceCodes = self.reduceCodes
            ,sdate = self.sdate, edate = self.edate, maxMissing = self.maxMissing,
            includeNormals = self.includeNormals, includeNormalDepartures = self.includeNormalDepartures)
        wxData.export('temp.csv')
        infile = open('temp.csv','r')
        testData = infile.read()
        refDataFile = open(Test_StationDataRequestor_getMonthlyWxSummaryByYear.rootFolder + self.refDataFile, 'r')
        refData = refDataFile.read()
        infile.close()
        refDataFile.close()
        os.remove('temp.csv')
        self.result =  list(numpy.setdiff1d(refData.split('/n'), testData.split('/n')))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号