示例#1
0
def testWhitelist():
    test_room = Room('test')
    test_user = User('user')
    assert not test_room.isWhitelisted(
        test_user), 'Wrongly accepted a not whitelisted user'
    assert test_room.addToWhitelist('user'), 'Failed to add user to whitelist'
    assert test_room.isWhitelisted(
        test_user), 'Whitelisted user not recognized'
示例#2
0
def test_whitelist():
    test_room = Room('test')
    test_user = User('bot', ' ', owner=False)
    test_room.addUser(test_user)
    assert not test_room.isWhitelisted(test_user), 'user should not be in white list'
    print(test_room.addToWhitelist(test_user))
    print([usr.id for usr in test_room.tourwhitelist], test_room.isWhitelisted(test_user))
    assert test_room.isWhitelisted(test_user), 'user should be in white list'
示例#3
0
def test_whitelist():
    test_room = Room('test')
    test_user = User('bot', ' ', owner=False)
    test_room.addUser(test_user)
    assert not test_room.isWhitelisted(
        test_user), 'user should not be in white list'
    print(test_room.addToWhitelist(test_user))
    print([usr.id for usr in test_room.tourwhitelist],
          test_room.isWhitelisted(test_user))
    assert test_room.isWhitelisted(test_user), 'user should be in white list'
def testWhitelist():
    test_room = Room('test')
    test_user = User('user')
    assert not test_room.isWhitelisted(test_user), 'Wrongly accepted a not whitelisted user'
    assert test_room.addToWhitelist('user'), 'Failed to add user to whitelist'
    assert test_room.isWhitelisted(test_user), 'Whitelisted user not recognized'