コード例 #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
ファイル: test_dif2.py プロジェクト: ZhangSteven/dif_revised
	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
ファイル: geneva.py プロジェクト: ZhangSteven/dif_revised
 def getRecordsGnt():
     file = join(get_current_path(), 'samples', 'CLM GNT 2017-10-25.xls')
     return readFile(file)
コード例 #8
0
ファイル: geneva.py プロジェクト: ZhangSteven/dif_revised
 def getRecordsBal():
     file = join(get_current_path(), 'samples', 'CLM BAL 2017-07-27.xls')
     return readFile(file)
コード例 #9
0
ファイル: geneva.py プロジェクト: ZhangSteven/dif_revised
 def getRecords():
     file = join(get_current_path(), 'samples',
                 'CL Franklin DIF 2018-05-28(2nd Revised).xls')
     return readFile(file)