예제 #1
0
def get_balance(currency, identifier, useragent=default_user_agent()):

    auto_currency = autodetect_currency(identifier)

    if not isinstance(auto_currency, list):
        currency = auto_currency

    return get_request(currency)(currency, identifier, useragent)
 def test_autodetect_omni(self):
     result = autodetect_currency('1CRne14GDzTQvKYv1uNuitocTNptF3qKCX')
     self.assertIsInstance(result, list)
     self.assertIn('OMNI', result)
 def test_autodetect_zec(self):
     self.assertEqual(
         autodetect_currency('t1KHa9CJeCy3b9rUX2BhqkFJXSxSSrhM7LJ'), 'ZEC',
         'Provided identifier has not been match according regexp.')
 def test_autodetect_nxt(self):
     self.assertEqual(
         autodetect_currency('NXT-7LB8-8ZPX-3YR9-3L85B'), 'NXT',
         'Provided identifier has not been match according regexp.')
 def test_autodetect_xrp(self):
     self.assertEqual(
         autodetect_currency('rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh'), 'XRP',
         'Provided identifier has not been match according regexp.')
 def test_autodetect_oa(self):
     self.assertEqual(
         autodetect_currency('akNgsNMWbjM4svehXchCPkPsLRVAMJU7nrj'), 'OA',
         'Provided identifier has not been match according regexp.')
 def test_autodetect_blk(self):
     self.assertEqual(
         autodetect_currency('B95qcCHpma5XZu4n6hP9pP5APiasCR16Ts'), 'BLK',
         'Provided identifier has not been match according regexp.')
 def test_autodetect_xem(self):
     self.assertEqual(
         autodetect_currency(
             'NCXIP5-JNP4GC-3JXXBB-U2UHF4-F4JYJ4-4DWFMN-EIMQ'), 'XEM',
         'Provided identifier has not been match according regexp.')
 def test_autodetect_ppc(self):
     self.assertEqual(
         autodetect_currency('PGVtF7DJ4KtndgdYZ472skrZQx3MDHNymt'), 'PPC',
         'Provided identifier has not been match according regexp.')
 def test_autodetect_dash(self):
     self.assertEqual(
         autodetect_currency('XfgNCeTJxBVHb9CCpn52QyfjfpBmPQUYdA'), 'DASH',
         'Provided identifier has not been match according regexp.')
 def test_autodetect_doge(self):
     self.assertEqual(
         autodetect_currency('DDogepartyxxxxxxxxxxxxxxxxxxw1dfzr'), 'DOGE',
         'Provided identifier has not been match according regexp.')
 def test_autodetect_ltc(self):
     self.assertEqual(
         autodetect_currency('LLiwS8XkQ7ra4XAg1TybTWrwnqFvMhiRfE'), 'LTC',
         'Provided identifier has not been match according regexp.')
 def test_autodetect_eth(self):
     self.assertEqual(
         autodetect_currency('0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359'),
         'ETH', 'Provided identifier has not been match according regexp.')