예제 #1
0
 def setup_class(self):
     self.share = Stock("AAPL")
     self.share2 = Stock("AAPL", output_format='pandas')
     self.share4 = Stock("AAPL",
                         json_parse_int=Decimal,
                         json_parse_float=Decimal)
     self.share5 = Stock("TSLA")
예제 #2
0
 def setup_class(self):
     self.cshare = Stock("aapl")
     self.cshare2 = Stock("aapl", output_format='pandas')
     self.cshare3 = Stock("svxy")
     self.cshare4 = Stock("aapl",
                          json_parse_int=Decimal,
                          json_parse_float=Decimal)
     self.cshare5 = Stock("gig^")
예제 #3
0
 def test_wrong_iex_input_type(self):
     with pytest.raises(ValueError):
         Stock(34)
     with pytest.raises(ValueError):
         Stock("")
     with pytest.raises(ValueError):
         ls = []
         Stock(ls)
예제 #4
0
 def setup_class(self):
     self.batch = Stock(["AAPL", "TSLA"])
     self.batch2 = Stock(["AAPL", "TSLA"], output_format='pandas')
     self.batch4 = Stock(["AAPL", "TSLA"],
                         json_parse_int=Decimal,
                         json_parse_float=Decimal)
예제 #5
0
 def test_invalid_symbol(self):
     data = Stock("BAD SYMBOL")
     with pytest.raises(IEXSymbolError):
         data.get_price()
예제 #6
0
 def test_invalid_symbol_or_symbols(self):
     with pytest.raises(IEXSymbolError):
         a = Stock(["TSLA", "BAD SYMBOL", "BAD SYMBOL"])
         a.get_price()
예제 #7
0
 def setup_class(self):
     self.cbatch = Stock(["aapl", "tsla"])
     self.cbatch2 = Stock(["aapl", "tsla"], output_format='pandas')
     self.cbatch3 = Stock(["uvxy", "svxy"])
예제 #8
0
 def test_symbol_list_too_long(self):
     with pytest.raises(ValueError):
         x = ["tsla"] * 102
         Stock(x)
예제 #9
0
 def test_listed_crypto_symbols(self):
     a = Stock(self.ticks)
     assert isinstance(a.get_quote(), dict)