def test_ok(self): updates = {} with mock.patch('scan.peers.get_country_by_ip', return_value='FR'): explore_peer('wallet.burst.devtrue.net', updates) self.assertDictEqual( updates, { 'wallet.burst.devtrue.net': { 'announced_address': 'wallet.burst.devtrue.net', 'application': 'BRS', 'country_code': 'FR', 'cumulative_difficulty': '64770577730996744870', 'height': 641103, 'last_online_at': datetime.datetime(2019, 7, 10, 17, 47, 6, 963229), 'platform': 'BURST-BTKF-8WT9-L98N-98JH2', 'version': 'v2.4.0' } })
def test_ok(self): updates = {} with mock.patch("scan.peers.get_country_by_ip", return_value="FR"): explore_peer("wallet.burst.devtrue.net", updates) self.assertDictEqual( updates, { "wallet.burst.devtrue.net": { "announced_address": "wallet.burst.devtrue.net", "application": "BRS", "country_code": "FR", "cumulative_difficulty": "64770577730996744870", "height": 641103, "last_online_at": datetime(2019, 7, 10, 17, 47, 6, 963229), "platform": "BURST-BTKF-8WT9-L98N-98JH2", "version": "v2.4.0", } }, )
def test_error(self): updates = {} explore_peer("wallet.burst.devtrue.net", updates) self.assertEqual(updates, {"wallet.burst.devtrue.net": None})
def test_old_version(self): updates = {} explore_peer("wallet.burstscan.net", updates) self.assertEqual(updates, {"wallet.burstscan.net": None})
def test_old_version(self): updates = {} explore_peer('wallet.burst.devtrue.net', updates) self.assertEqual(updates, {'wallet.burst.devtrue.net': None})