def test_similar_sets(self): test_hsi = TestHandleSetInfo set_info1 = test_hsi._test_set_info set_info1.set_conditions({'NM': 0, 'LP': 0, 'MP': 0, 'HP': 1, 'D': 0}) card1 = test_hsi._test_card card1.set_set_info([set_info1]) set_info2 = test_hsi._test_set_info set_info2.set_conditions({'NM': 1, 'LP': 1, 'MP': 0, 'HP': 0, 'D': 0}) card2 = test_hsi._test_card card2.set_set_info([set_info2]) result_card = DataImport.handle_set_info(card1, card2) expected_set_info = test_hsi._test_set_info expected_set_info.set_conditions({ 'NM': 1, 'LP': 1, 'MP': 0, 'HP': 1, 'D': 0 }) expected_card = test_hsi._test_card expected_card.set_set_info([expected_set_info]) self.assertEqual(result_card, expected_card)
def test_different_sets(self): test_hsi = TestHandleSetInfo test_set_info2 = test_hsi._test_set_info test_set_info2.set_edition('FE') test_card2 = test_hsi._test_card test_card2.set_set_info([test_set_info2]) result_card = DataImport.handle_set_info(test_hsi._test_card, test_card2) expected_card = test_hsi._test_card expected_card.set_set_info([test_set_info2, test_hsi._test_set_info]) self.assertEqual(result_card, expected_card)
def test_same_sets(self): test_hsi = TestHandleSetInfo result_card = DataImport.handle_set_info(test_hsi._test_card, test_hsi._test_card) expected_set_info = test_hsi._test_set_info expected_set_info.set_conditions({ 'NM': 2, 'LP': 0, 'MP': 0, 'HP': 0, 'D': 0 }) expected_card = test_hsi._test_card expected_card.set_set_info([expected_set_info]) self.assertEqual(result_card, expected_card)
def test_same_set_different_editions(self): test_hsi = TestHandleSetInfo set_info1 = test_hsi._test_set_info card1 = test_hsi._test_card set_info2 = test_hsi._test_set_info set_info2.set_conditions({'NM': 0, 'LP': 0, 'MP': 0, 'HP': 0, 'D': 1}) set_info2.set_edition(None) card2 = test_hsi._test_card card2.set_set_info([set_info2]) result_card = DataImport.handle_set_info(card1, card2) expected_card = test_hsi._test_card expected_card.set_set_info([set_info2, set_info1]) self.assertEqual(result_card, expected_card)