def test_define_card_object(self): header = [ 'name', 'race_type', 'attribute', 'level', 'attack', 'defense', 'edition', 'set_number', 'pass_code', 'condition' ] indexes = DataImport.init_indexes(header) card_info = [ 'Blue-Eyes White Dragon', 'Dragon', 'Light', 8, 3000, 2500, None, 'SDK-001', 89631139, 'LP' ] card_object = DataImport.define_card_object(indexes, card_info) predefined_set_object = SetInfo(set_number='SDK-001', conditions={ 'NM': 0, 'LP': 1, 'MP': 0, 'HP': 0, 'D': 0 }) predefined_card_object = Card(name='Blue-Eyes White Dragon', race='Dragon', monster_type='Normal Monster', attribute='Light', level=8, attack=3000, defense=2500, pass_code=89631139, set_info=[predefined_set_object]) self.assertEqual(card_object, predefined_card_object)
def test_init_indexes_not_registered(self): header = [ 'name', 'race_type', 'attributes', 'level', 'attack', 'defense', 'pass_code', 'description', 'set_number', 'edition', 'rarity', 'condition' ] result = DataImport.init_indexes(header) self.assertEqual(result.get('attributes'), None) self.assertEqual(result.get('rarity'), 10)