def test_get_prev_block_contributors_info(self):
    manager = PRepManager(is_generator_rotation=True, gen_count_per_leader=1)
    info = manager.get_prev_block_contributors_info()
    self.assertEqual(keystore_test1.get('address'), info.get('prevBlockGenerator'))
    self.assertEqual(0, len(info.get('prevBlockValidators')))
    manager = PRepManager(is_generator_rotation=True, gen_count_per_leader=1, prep_list=PREP_LIST)
    info = manager.get_prev_block_contributors_info()
    self.assertEqual(PREP_LIST[0].get('id'), info.get('prevBlockGenerator'))
    self.assertEqual((len(PREP_LIST) - 1), len(info.get('prevBlockValidators')))
    self.assertEqual(PREP_LIST[1].get('id'), info.get('prevBlockValidators')[0])
    info = manager.get_prev_block_contributors_info()
    self.assertEqual(PREP_LIST[1].get('id'), info.get('prevBlockGenerator'))
    self.assertEqual((len(PREP_LIST) - 1), len(info.get('prevBlockValidators')))
    self.assertEqual(PREP_LIST[0].get('id'), info.get('prevBlockValidators')[0])
def test_get_prev_block_contributors_info(self):
    manager = PRepManager(is_generator_rotation=True, gen_count_per_leader=1)
    info = manager.get_prev_block_contributors_info()
    self.assertEqual(keystore_test1.get('address'), info.get('prevBlockGenerator'))
    self.assertEqual(0, len(info.get('prevBlockValidators')))
    manager = PRepManager(is_generator_rotation=True, gen_count_per_leader=1, prep_list=PREP_LIST)
    info = manager.get_prev_block_contributors_info()
    self.assertEqual(PREP_LIST[0].get('id'), info.get('prevBlockGenerator'))
    self.assertEqual((len(PREP_LIST) - 1), len(info.get('prevBlockValidators')))
    self.assertEqual(PREP_LIST[1].get('id'), info.get('prevBlockValidators')[0])
    info = manager.get_prev_block_contributors_info()
    self.assertEqual(PREP_LIST[1].get('id'), info.get('prevBlockGenerator'))
    self.assertEqual((len(PREP_LIST) - 1), len(info.get('prevBlockValidators')))
    self.assertEqual(PREP_LIST[0].get('id'), info.get('prevBlockValidators')[0])