Beispiel #1
0
    def test_leader_board(self):
        iq_api = IQOption(email, password, 'DEBUG')
        check, reason = iq_api.connect()
        self.assertTrue(check)
        self.assertIsNone(reason)
        iq_api.change_balance("PRACTICE")
        self.assertTrue(iq_api.check_connect())

        print(
            '___________________________ 100 Near Traders to this ranking account ______________________'
        )
        near_traders = iq_api.get_leader_board(country=30,
                                               near_traders_count=100,
                                               pooling_time=120)
        for k, v in near_traders['near_traders'].items():
            print(' -> {} Name: {} - Profit: {} Country: {}'.format(
                k, v['user_name'], v['score'], v['flag']))

        time.sleep(30)

        print(
            '___________________________ Top 10 Countries Ranking  ______________________'
        )
        top_ten_country = iq_api.get_top_ten_countries()
        self.assertTrue(len(top_ten_country) == 10)
        for k, v in top_ten_country.items():
            print(' -> {} - {} Profit: {}'.format(k, v['country_name'],
                                                  v['profit']))

        # time.sleep(30)
        #
        # print('___________________________ Top 100000 Worldwide Traders  ______________________')
        # top_traders = iq_api.get_positional_ranking_traders(to_position=100000)
        # self.assertIsNotNone(top_traders)
        # print('Top Traders Country {} ->'.format(top_traders))

        time.sleep(30)

        print(
            '___________________________ Top 50 Brazilians Traders  ______________________'
        )
        country = 'Brazil'
        top_traders_country = iq_api.get_positional_ranking_traders(
            country=country, to_position=50)
        print('Top Traders Country {} ->  {} '.format(country,
                                                      top_traders_country))

        iq_api.close_connect()
Beispiel #2
0
 def test_users(self):
     iq_api = IQOption(email, password)
     iq_api.connect()
     iq_api.change_balance("PRACTICE")
     self.assertEqual(iq_api.check_connect(), True)
     users = iq_api.get_leader_board('Worldwide', 1, 20, 0)
     for k, v in users['positional'].items():
         user_data = iq_api.get_users_availability(v['user_id'])
         print(user_data)
         user_datas = iq_api.request_leaderboard_userinfo_deals_client(
             v['user_id'], v['flag'])
         self.assertTrue(type(user_datas) is dict)
         print(user_datas)
         self.assertTrue(
             type(iq_api.get_user_profile_client(v['user_id'])) is dict)
         time.sleep(.2)
     iq_api.close_connect()