示例#1
0
    def setUpClass(TestBal):
        """
		Called only once before all tests
		"""
        file = join(get_current_path(), 'samples', 'CLM BAL 2017-07-27.xls')
        wb = open_workbook(filename=file)
        TestBal.balrecords = readHolding(wb.sheet_by_name('Portfolio Val.'))
        TestBal.balsummary = readSummary(wb.sheet_by_name('Portfolio Sum.'))

        file = join(get_current_path(), 'samples', 'CLM GNT 2017-10-25.xls')
        wb = open_workbook(filename=file)
        TestBal.gntrecords = readHolding(wb.sheet_by_name('Portfolio Val.'))
        TestBal.gntsummary = readSummary(wb.sheet_by_name('Portfolio Sum.'))
示例#2
0
    def testValidateBal2(self):
        file = join(get_current_path(), 'samples', 'CLM BAL 2018-05-31.xls')
        records, summary = readFile(file)
        equityRecords = list(filter(equity, records))
        self.assertEqual(len(equityRecords), 26)

        record = equityRecords[17]
        self.assertEqual(record['ticker'], '6886 HK')
        self.assertEqual(record['quantity'], 60000)
示例#3
0
    def setUpClass(TestDif):
        """
		Called only once before all tests
		"""
        file = join(get_current_path(), 'samples',
                    'CL Franklin DIF 2018-05-28(2nd Revised).xls')
        wb = open_workbook(filename=file)
        TestDif.records = readHolding(wb.sheet_by_name('Portfolio Val.'))
        TestDif.summary = readSummary(wb.sheet_by_name('Portfolio Sum.'))
示例#4
0
	def testAll(self):
		file = join(get_current_path(), 'samples', 
						'CL Franklin DIF 2018-07-24.xls')
		wb = open_workbook(filename=file)
		records = readHolding(wb.sheet_by_name('Portfolio Val.'))
		summary = readSummary(wb.sheet_by_name('Portfolio Sum.'))
		try:
			validate(records, summary)
		except e:
			self.fail('validation failed ' + e)
示例#5
0
 def allRecords():
     file = join(get_current_path(), 'samples',
                 'CL Franklin DIF 2018-05-28(2nd Revised).xls')
     wb = open_workbook(file)
     return readHolding(wb.sheet_by_name('Portfolio Val.'))
示例#6
0
 def futuresSection():
     file = join(get_current_path(), 'samples',
                 'CL Franklin DIF 2018-05-28(2nd Revised).xls')
     ws = open_workbook(filename=file).sheet_by_name('Portfolio Val.')
     sections = linesToSections(worksheetToLines(ws))
     return sections[19]
示例#7
0
 def getRecordsGnt():
     file = join(get_current_path(), 'samples', 'CLM GNT 2017-10-25.xls')
     return readFile(file)
示例#8
0
 def getRecordsBal():
     file = join(get_current_path(), 'samples', 'CLM BAL 2017-07-27.xls')
     return readFile(file)
示例#9
0
 def getRecords():
     file = join(get_current_path(), 'samples',
                 'CL Franklin DIF 2018-05-28(2nd Revised).xls')
     return readFile(file)