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


Python User.hasRank方法代码示例

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


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

示例1: test_user_rank

# 需要导入模块: from user import User [as 别名]
# 或者: from user.User import hasRank [as 别名]
def test_user_rank():
    reg_user = User('user', '~')
    assert reg_user.hasRank('+'), 'rank comparison is off'
    reg_user = User('user', '*')
    assert reg_user.hasRank('@'), 'rank comparison is off'
    reg_user = User('user', '%')
    assert reg_user.hasRank('+'), 'rank comparison is off'
开发者ID:wgma00,项目名称:PokemonShowdownBot,代码行数:9,代码来源:test_user.py

示例2: testLowerRankComparision

# 需要导入模块: from user import User [as 别名]
# 或者: from user.User import hasRank [as 别名]
def testLowerRankComparision():
    reg_user = User('user1', '@')
    assert reg_user.hasRank('+'), 'Invalid rank comparision; it should not get @ < +'
开发者ID:QuiteQuiet,项目名称:PokemonShowdownBot,代码行数:5,代码来源:test_user.py

示例3: testHigherRankComparision

# 需要导入模块: from user import User [as 别名]
# 或者: from user.User import hasRank [as 别名]
def testHigherRankComparision():
    reg_user = User('user1')
    assert not reg_user.hasRank('~'), 'Invalid rank comparision; it should not get \' \' >= ~'
开发者ID:QuiteQuiet,项目名称:PokemonShowdownBot,代码行数:5,代码来源:test_user.py

示例4: testNonexistingRank

# 需要导入模块: from user import User [as 别名]
# 或者: from user.User import hasRank [as 别名]
def testNonexistingRank():
    false_user = User('user', '=')
    assert not false_user.hasRank(' '), 'Nonexisting ranks should not be recognized as anything'
开发者ID:QuiteQuiet,项目名称:PokemonShowdownBot,代码行数:5,代码来源:test_user.py

示例5: test_user_rank_untested

# 需要导入模块: from user import User [as 别名]
# 或者: from user.User import hasRank [as 别名]
def test_user_rank_untested():
    with pytest.raises(UnSpecifiedUserRankException):
        reg_user = User('user', '+')
        reg_user.hasRank('not valid')
开发者ID:wgma00,项目名称:PokemonShowdownBot,代码行数:6,代码来源:test_user.py

示例6: test_user_owner_privileges

# 需要导入模块: from user import User [as 别名]
# 或者: from user.User import hasRank [as 别名]
def test_user_owner_privileges():
    reg_user = User('user', ' ')
    owner = User('user', ' ', owner=True)
    assert owner.hasRank('~'), 'owner is not recognized in rank comparison'
    assert owner.isOwner(), 'owner is not owner'
    assert not reg_user.isOwner(), 'regular user is recognized as owner'
开发者ID:wgma00,项目名称:PokemonShowdownBot,代码行数:8,代码来源:test_user.py


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