本文整理汇总了Python中card.Card.valueString方法的典型用法代码示例。如果您正苦于以下问题:Python Card.valueString方法的具体用法?Python Card.valueString怎么用?Python Card.valueString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类card.Card
的用法示例。
在下文中一共展示了Card.valueString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_stringRepresentations
# 需要导入模块: from card import Card [as 别名]
# 或者: from card.Card import valueString [as 别名]
def test_stringRepresentations(self):
aceOfClubs = Card(0, 0)
self.assertEqual("Clubs", aceOfClubs.suitString())
self.assertEqual("Ace", aceOfClubs.valueString())
self.assertEqual("Ace of Clubs", str(aceOfClubs))
nineOfDiamonds = Card(1, 8)
self.assertEqual("Diamonds", nineOfDiamonds.suitString())
self.assertEqual("9", nineOfDiamonds.valueString())
self.assertEqual("9 of Diamonds", str(nineOfDiamonds))
queenOfSpades = Card(2, 11)
self.assertEqual("Spades", queenOfSpades.suitString())
self.assertEqual("Queen", queenOfSpades.valueString())
self.assertEqual("Queen of Spades", str(queenOfSpades))
jackOfHearts = Card(3, 10)
self.assertEqual("Hearts", jackOfHearts.suitString())
self.assertEqual("Jack", jackOfHearts.valueString())
self.assertEqual("Jack of Hearts", str(jackOfHearts))
kingOfSuit4 = Card(4, 12)
self.assertEqual("Suit 4", kingOfSuit4.suitString())
self.assertEqual("King", kingOfSuit4.valueString())
self.assertEqual("King of Suit 4", str(kingOfSuit4))