Beispiel #1
0
 def test_empty(self):
     o = PriceDict('')
     self.assertEqual(o.data(), {})
Beispiel #2
0
 def test_same_share_repeated(self):
     o = PriceDict(DATA_SAME_SHARE_REPEATED)
     self.assertEqual(o.data(), {'AAL.L': ['1484.0', 'GBp'] })
Beispiel #3
0
 def test_mixed_query(self):
     o = PriceDict(DATA_MIXED)
     self.assertEqual(o.data(), {'AAL.L':    ['1484.0',   'GBp'],
                          'GBPUSD=X': ['1.315824', 'USD'],
                      })
Beispiel #4
0
 def test_one_index(self):
     o = PriceDict(DATA_ONE_INDEX)  #NOTE: key is ^FTSE
     self.assertEqual(o.data(), { '^FTSE': ['7492.57', 'GBP'] })
Beispiel #5
0
 def test_one_fx(self):
     o = PriceDict(DATA_ONE_FX)  #NOTE: key is GBPEUR=X
     self.assertEqual(o.data(), { 'GBPEUR=X': ['1.1277249', 'EUR'] })
Beispiel #6
0
 def test_two_shares(self):
     o = PriceDict(DATA_TWO_SHARES)
     self.assertEqual(o.data(), {
         'BARC.L': ['178.95', 'GBp'],
         'VOD.L':  ['220.95', 'GBp'],
     })
Beispiel #7
0
 def test_one_share(self):
     o = PriceDict(DATA_ONE_SHARE)
     self.assertEqual(o.data(), { 'GSK.L': ['1351.0', 'GBp'] })
Beispiel #8
0
 def test_known_symbol_wrong_exchange(self):
     o = PriceDict(DATA_KNOWN_SYMBOL_WRONG_EXCHANGE)
     self.assertEqual(o.data(), {'AAT.L': ['', '']} )
Beispiel #9
0
 def test_unknown_symbol(self):
     o = PriceDict(DATA_UNKNOWN_SYMBOL)
     self.assertEqual(o.data(), {})
Beispiel #10
0
 def test_empty_symbol(self):
     o = PriceDict(DATA_EMPTY_SYMBOL)
     self.assertEqual(o.data(), {})