当前位置: 首页>>代码示例>>Python>>正文


Python Commons.ordinal方法代码示例

本文整理汇总了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."
开发者ID:joshcoales,项目名称:Hallo,代码行数:25,代码来源:testCommons.py


注:本文中的inc.Commons.Commons.ordinal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。