當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。