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


Python IkaUtils.death_reason2text方法代码示例

本文整理汇总了Python中ikalog.utils.IkaUtils.death_reason2text方法的典型用法代码示例。如果您正苦于以下问题:Python IkaUtils.death_reason2text方法的具体用法?Python IkaUtils.death_reason2text怎么用?Python IkaUtils.death_reason2text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ikalog.utils.IkaUtils的用法示例。


在下文中一共展示了IkaUtils.death_reason2text方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_death_reason2text

# 需要导入模块: from ikalog.utils import IkaUtils [as 别名]
# 或者: from ikalog.utils.IkaUtils import death_reason2text [as 别名]
    def test_death_reason2text(self):
        ### Weapons
        reason = 'hokusai'

        # English
        self.assertEqual('Octobrush',
                         IkaUtils.death_reason2text(reason, languages='en'))

        # Japanese
        self.assertEqual('ホクサイ',
                         IkaUtils.death_reason2text(reason, languages='ja'))

        # Fallback to English
        self.assertEqual('Octobrush',
                         IkaUtils.death_reason2text(reason, languages='??'))

        # Multiple languages
        self.assertEqual('ホクサイ',
                         IkaUtils.death_reason2text(reason,
                                                    languages=['ja', 'en']))

        ### Sub weapons
        reason = 'trap'
        self.assertEqual('Ink Mine',
                         IkaUtils.death_reason2text(reason, languages='en'))
        self.assertEqual('トラップ',
                         IkaUtils.death_reason2text(reason, languages='ja'))

        ### Special weapons
        reason = 'daioika'
        self.assertEqual('Kraken',
                         IkaUtils.death_reason2text(reason, languages='en'))
        self.assertEqual('ダイオウイカ',
                         IkaUtils.death_reason2text(reason, languages='ja'))

        ### Hurtable objects
        reason = 'hoko_shot'
        self.assertEqual('Rainmaker Shot',
                         IkaUtils.death_reason2text(reason, languages='en'))
        self.assertEqual('ガチホコショット',
                         IkaUtils.death_reason2text(reason, languages='ja'))

        ### OOB reasons
        reason = 'oob'
        self.assertEqual('Out of Bounds',
                         IkaUtils.death_reason2text(reason, languages='en'))
        self.assertEqual('場外',
                         IkaUtils.death_reason2text(reason, languages='ja'))

        ### Unkonwn
        unknown_reason = 'unknown'
        self.assertEqual('?', IkaUtils.death_reason2text(unknown_reason))
        self.assertEqual('<:=',
                         IkaUtils.death_reason2text(unknown_reason,
                                                    unknown='<:='))
开发者ID:clovervidia,项目名称:IkaLog,代码行数:57,代码来源:test_ikautils.py


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