예제 #1
0
 def test8(self):
     Input = CrifUtil.read_csv(r'../Testdatensatz1_CRIF.csv')
     crifs = Crifs(Input)
     crif = crifs['CDS-10015292-18_collect_EMIR']
     leArray = crif.getAllSchedulePVs()
     value = leArray[0].getAmountUSD().doubleValue()
     self.assertEqual(value, 4831209.57108)
예제 #2
0
 def test1(self):
     Input = CrifUtil.read_csv(r'../NochKleineresTestportfolio.csv')
     crif = Crif(Input)
     self.assertEqual('IMLedis_NRW_Bank', crif.Counterparty)
     self.assertEqual('collect', crif.direction)
     self.assertEqual('EMIR', crif.regulation)
     del crif
예제 #3
0
 def test9(self):
     Input = CrifUtil.read_csv(r'../Unittest_CRIF.txt', sep='\t')
     crifs = Crifs(Input)
     crif = crifs['testAN1_collect_EMIR']
     notionals = crif.getAllAddonNotionals()
     factors = crif.getAllAddOnNotionalFactors()
     notionals = JavaArrayListToPythonList(notionals)
     factors = JavaArrayListToPythonList(factors)
     self.assertEqual(notionals[0].getNotional().doubleValue(), 10000000.0)
     self.assertEqual(factors[0].getFactor().doubleValue(), 6.105)
예제 #4
0
 def test7(self):
     Input = CrifUtil.read_csv(r'../Testdatensatz1_CRIF.csv')
     crifs = Crifs(Input)
     crif = crifs.values().__iter__().__next__()
     leArray = crif.getAllScheduleNotionals()
     value = leArray[0].getAmount().doubleValue()
     self.assertEqual(value, 140002181.4934)
     crif = crifs['CDS-10015292-18_collect_EMIR']
     leArray = crif.getAllScheduleNotionals()
     value = leArray[3].getAmountUSD().doubleValue()
     self.assertEqual(value, 18000000)
예제 #5
0
 def test5(self):
     Input = CrifUtil.read_csv(r'../testIR11asCRIF.csv')
     crif1 = Crif(Input)
     crif2 = Crif(Input)
     self.assertEqual(
         31773442304,
         round(
             Simm.calculateStandard(crif1.getAllSensitivities(),
                                    'USD').doubleValue()))
     self.assertEqual(
         31773442304,
         round(
             Simm.calculateStandard(crif2.getAllSensitivities(),
                                    'USD').doubleValue()))
예제 #6
0
 def test1(self):
     Input = CrifUtil.read_csv(r'../Testdatensatz1_CRIF.csv')
     crifs = Crifs(Input)
     self.assertEqual('CDS-10005292-18_collect_EMIR', crifs.keys().__iter__().__next__())
예제 #7
0
 def test2(self):
     Input = CrifUtil.read_csv(r'../Testdatensatz1_CRIF.csv')
     crifs = Crifs(Input)
     self.assertEqual(crifs.__len__(), 8)
예제 #8
0
 def test3(self):
     Input = CrifUtil.read_csv(r'../NochKleineresTestportfolio.csv')
     crif = Crif(Input)
     self.assertEqual(True, crif.asDataFrame.equals(Input))
     del crif
예제 #9
0
 def test2(self):
     Input = CrifUtil.read_csv(r'../Testdatensatz1_CRIF.csv')
     self.assertRaises(ValueError, Crif, Input)