def test_JumpStart(self): threegeneric = MgManaExpression( MgManaSymbol(colorv=None, modifiers=None, cvalue=3)) ability = MgJumpStartAbility(cost=threegeneric) self.assertTrue(ability.isTraversable()) self.assertEqual(len(ability.getTraversalSuccessors()), 1) self.assertTrue(ability.isChild(threegeneric)) self.assertEqual(threegeneric.getParent(), ability) self.assertEqual(ability.getCost(), threegeneric) self.assertEqual(ability.unparseToString().lower(), "jump-start {3}")
def test_Morph(self): threegeneric = MgManaExpression( MgManaSymbol(colorv=None, modifiers=None, cvalue=3)) ability = MgMorphAbility(cost=threegeneric) self.assertTrue(ability.isTraversable()) self.assertEqual(len(ability.getTraversalSuccessors()), 1) self.assertTrue(ability.isChild(threegeneric)) self.assertEqual(threegeneric.getParent(), ability) self.assertEqual(ability.getCost(), threegeneric) self.assertEqual(ability.unparseToString().lower(), "morph {3}") self.assertFalse(ability.isMegamorphAbility()) ability.setIsMegamorphAbility(True) self.assertEqual(ability.unparseToString().lower(), "megamorph {3}")
def test_Equip(self): manaExpr = MgManaExpression(MgManaSymbol(cvalue=4)) ability = MgEquipAbility(cost=manaExpr) self.assertTrue(ability.isTraversable()) self.assertEqual(len(ability.getTraversalSuccessors()), 1) self.assertTrue(ability.isChild(manaExpr)) self.assertEqual(manaExpr.getParent(), ability) self.assertEqual(ability.unparseToString().lower(), "equip {4}") t_planetouched = MgTypeExpression(MgSupertype("Planetouched")) equip_planetouched = MgEquipAbility(cost=manaExpr, quality=t_planetouched) self.assertEqual(len(equip_planetouched.getTraversalSuccessors()), 2) self.assertEqual(equip_planetouched.unparseToString().lower(), "equip planetouched {4}")
def test_Splice(self): t_arcane = MgTypeExpression( MgSubtype(MgSubtype.SpellSubtypeEnum.Arcane)) s0 = MgManaSymbol(cvalue=1) s1 = MgManaSymbol(colorv=MgManaSymbol.ManaType.White) s2 = MgManaSymbol(colorv=MgManaSymbol.ManaType.White) manaExpr = MgManaExpression(s0, s1, s2) ability = MgSpliceAbility(cost=manaExpr, spliceType=t_arcane) self.assertTrue(ability.isTraversable()) self.assertEqual(len(ability.getTraversalSuccessors()), 2) self.assertTrue(ability.isChild(t_arcane)) self.assertEqual(manaExpr.getParent(), ability) self.assertEqual(ability.getCost(), manaExpr) self.assertEqual(ability.unparseToString().lower(), "splice onto arcane {1}{w}{w}")