'Testing whether the API returns the correct statistics'

@deferred(timeout=10)
def test_get_statistics_no_data(self):

    def verify_response(response):
        response_json = json.loads(response)
        self.assertTrue(('statistics' in response_json))
        stats = response_json['statistics']
        self.assertEqual(stats['id'], self.member.public_key.encode('HEX'))
        self.assertEqual(stats['total_blocks'], 0)
        self.assertEqual(stats['total_up'], 0)
        self.assertEqual(stats['total_down'], 0)
        self.assertEqual(stats['peers_that_pk_helped'], 0)
        self.assertEqual(stats['peers_that_helped_pk'], 0)
        self.assertNotIn('latest_block', stats)
    self.should_check_equality = False
    return self.do_request('trustchain/statistics', expected_code=200).addCallback(verify_response)
