示例#1
0
 def test_get_price(self):
     self.bds = BovespaDataSource(self.file_location, "AALR3")
     price = self.bds._get_price()
     self.assertEqual(price, 13.25)
示例#2
0
 def test_get_many_prices(self):
     self.bds = BovespaDataSource(self.file_location, "AALR3")
     price = 0
     for _ in range(50):
         price = self.bds._get_price()
     self.assertIsNot(price, 0)
示例#3
0
 def test_get_code(self):
     self.bds = BovespaDataSource(self.file_location, "APPLE")
     code = self.bds._get_code()
     self.assertEqual(code, "AALR3")
示例#4
0
 def test_close_file(self):
     self.bds = BovespaDataSource(self.file_location)
     self.bds._open_file()
     self.bds._close_file()
示例#5
0
 def test_read_line(self):
     self.bds = BovespaDataSource(self.file_location)
     self.bds._open_file()
     line_got = self.bds._read_line()
     line_real = "00COTAHIST.2019BOVESPA 20190322                                                                                                                                                                                                                      \n"
     self.assertEqual(line_got, line_real)
示例#6
0
 def test_open_file(self):
     self.bds = BovespaDataSource(self.file_location)
     self.bds._open_file()
     self.assertIsNotNone(self.bds._file)
示例#7
0
 def test_bovespa_dataource_creation(self):
     self.bds = BovespaDataSource(self.file_location)