本文整理汇总了Python中inc.Commons.Commons.ordinal方法的典型用法代码示例。如果您正苦于以下问题:Python Commons.ordinal方法的具体用法?Python Commons.ordinal怎么用?Python Commons.ordinal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类inc.Commons.Commons
的用法示例。
在下文中一共展示了Commons.ordinal方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_ordinal
# 需要导入模块: from inc.Commons import Commons [as 别名]
# 或者: from inc.Commons.Commons import ordinal [as 别名]
def test_ordinal(self):
assert Commons.ordinal(1) == "1st", "1st ordinal incorrect."
assert Commons.ordinal(2) == "2nd", "2nd ordinal incorrect."
assert Commons.ordinal(3) == "3rd", "3rd ordinal incorrect."
assert Commons.ordinal(4) == "4th", "4th ordinal incorrect."
assert Commons.ordinal(5) == "5th", "5th ordinal incorrect."
assert Commons.ordinal(10) == "10th", "10th ordinal incorrect."
assert Commons.ordinal(11) == "11th", "11th ordinal incorrect."
assert Commons.ordinal(12) == "12th", "12th ordinal incorrect."
assert Commons.ordinal(13) == "13th", "13th ordinal incorrect."
assert Commons.ordinal(14) == "14th", "14th ordinal incorrect."
assert Commons.ordinal(20) == "20th", "20th ordinal incorrect."
assert Commons.ordinal(21) == "21st", "21st ordinal incorrect."
assert Commons.ordinal(22) == "22nd", "22nd ordinal incorrect."
assert Commons.ordinal(23) == "23rd", "23rd ordinal incorrect."
assert Commons.ordinal(24) == "24th", "24th ordinal incorrect."
assert Commons.ordinal(100) == "100th", "100th ordinal incorrect."
assert Commons.ordinal(101) == "101st", "101st ordinal incorrect."
assert Commons.ordinal(102) == "102nd", "102nd ordinal incorrect."
assert Commons.ordinal(103) == "103rd", "103rd ordinal incorrect."
assert Commons.ordinal(104) == "104th", "104th ordinal incorrect."
assert Commons.ordinal(111) == "111th", "111th ordinal incorrect."
assert Commons.ordinal(121) == "121st", "121st ordinal incorrect."