Esempio n. 1
0
 def test_parseJSONResponse(self):
     json1 = """
             {"asks":[[3.29551,0.5],[3.29584,5]],
             "bids":[[3.29518,15.51461],[3,27.5]]}
             """
     parsed = parseJSONResponse(json1)
     asks = parsed.get("asks")
     self.assertEqual(asks[0], [decimal.Decimal("3.29551"), decimal.Decimal("0.5")])
     self.assertEqual(asks[1], [decimal.Decimal("3.29584"), decimal.Decimal("5")])
     bids = parsed.get("bids")
     self.assertEqual(bids[0], [decimal.Decimal("3.29518"), decimal.Decimal("15.51461")])
     self.assertEqual(bids[1], [decimal.Decimal("3"), decimal.Decimal("27.5")])
Esempio n. 2
0
 def test_parseJSONResponse(self):
     json1 = """
             {"asks":[[3.29551,0.5],[3.29584,5]],
             "bids":[[3.29518,15.51461],[3,27.5]]}
             """
     parsed = parseJSONResponse(json1)
     asks = parsed.get("asks")
     self.assertEqual(asks[0], [decimal.Decimal("3.29551"),
                                decimal.Decimal("0.5")])
     self.assertEqual(asks[1], [decimal.Decimal("3.29584"),
                                decimal.Decimal("5")])
     bids = parsed.get("bids")
     self.assertEqual(bids[0], [decimal.Decimal("3.29518"),
                                decimal.Decimal("15.51461")])
     self.assertEqual(bids[1], [decimal.Decimal("3"),
                                decimal.Decimal("27.5")])