Пример #1
0
    def test_trade_limit(self):
        res = PublicApi().get_pair_trades(pair="ltc_btc", limit=166)

        self.assertEqual(166, len(res))

        res = PublicApi().get_pair_trades(pair="ltc_btc", limit=177)
        self.assertEqual(177, len(res))
Пример #2
0
    def test_valid_depths(self):
        res = PublicApi().get_pairs_depth(
            pairs=['ltc_btc', 'btc_usd', 'etc_btc'])

        self.assertIsNotNone(res)
        self.assertIsNotNone(res.get("ltc_btc"))

        self.assertIsNotNone(res)
        self.assertIsNotNone(res.get("btc_usd"))

        self.assertIsNotNone(res)
        self.assertIsNotNone(res.get("etc_btc"))
Пример #3
0
    def test_depths_limit(self):
        res = PublicApi().get_pairs_depth(
            pairs=['ltc_btc', 'btc_usd', 'etc_btc'], limit=177)

        self.assertEqual(177, len(res['ltc_btc']['bids']))
        self.assertEqual(177, len(res['btc_usd']['bids']))
        self.assertEqual(177, len(res['etc_btc']['bids']))
Пример #4
0
    def test_invalid_depth(self):
        res = PublicApi().get_pair_depth(pair="ltc_btcAa")
        self.assertEqual(404, res.get("status_code"))

        res = PublicApi().get_pair_depth(pair="ltc_btc23")
        self.assertEqual(0, res.get("success"))
        self.assertEqual("Invalid pair name: ltc_btc23", res.get("error"))
Пример #5
0
    def test_depth_limit(self):
        res = PublicApi().get_pair_depth(pair="ltc_btc", limit=166)
        self.assertEqual(166, len(res['bids']))

        res = PublicApi().get_pair_depth(pair="ltc_btc", limit=177)
        self.assertEqual(177, len(res['bids']))
Пример #6
0
    def test_invalid_depths(self):
        res = PublicApi().get_pairs_depth(pairs=['ltc_btc', 'test', 'etc_btc'])

        self.assertEqual(0, res.get("success"))
        self.assertEqual("Invalid pair name: test", res.get("error"))
Пример #7
0
    def test_info(self):
        res = PublicApi().get_info()

        b = True if len(res['pairs']) > 500 else False
        self.assertEqual(True, b)
Пример #8
0
    def test_valid_depth(self):
        res = PublicApi().get_pair_depth(pair="ltc_btc")

        self.assertIsNotNone(res)
        self.assertIsNotNone(res.get("bids"))
Пример #9
0
    def test_valid_ticker(self):
        res = PublicApi().get_pair_ticker(pair="ltc_btc")

        self.assertIsNotNone(res)
        self.assertIsNotNone(res.get("high"))
Пример #10
0
    def test_valid_trade(self):
        res = PublicApi().get_pair_trades(pair="ltc_btc")

        self.assertIsNotNone(res)
        self.assertIsNotNone(res[0].get("price"))
        self.assertIsNotNone(res[0].get("type"))