示例#1
0
def test_wrong_client_is_not_allowed():
    clients_tokens = get_clients_tokens(correct_file_with_master_key)
    client_token_is_allowed(clients_tokens, 'centre', '9bf5')
    clients_tokens = get_clients_tokens(correct_file_without_master_key)
    client_token_is_allowed(clients_tokens, 'centre', '9bf5')
示例#2
0
def test_client_with_master_token_is_allowed():
    clients_tokens = get_clients_tokens(correct_file_with_master_key)
    assert client_token_is_allowed(clients_tokens, 'transilien', '42')
    assert client_token_is_allowed(clients_tokens, 'another_one', '42')
示例#3
0
def test_client_with_wrong_token_is_not_allowed():
    clients_tokens = get_clients_tokens(correct_file_with_master_key)
    client_token_is_allowed(clients_tokens, 'transilien', '1')
    clients_tokens = get_clients_tokens(correct_file_without_master_key)
    client_token_is_allowed(clients_tokens, 'transilien', '1')
示例#4
0
def test_client_token_file_doesnt_exist():
    assert get_clients_tokens(wrong_file) == None
示例#5
0
def test_client_with_second_token_is_allowed():
    clients_tokens = get_clients_tokens(correct_file_with_master_key)
    assert client_token_is_allowed(clients_tokens, 'transilien', '9bf6')
    clients_tokens = get_clients_tokens(correct_file_without_master_key)
    assert client_token_is_allowed(clients_tokens, 'transilien', '9bf6')
示例#6
0
文件: utils_test.py 项目: dvdn/Chaos
def test_wrong_client_is_not_allowed():
    clients_tokens = get_clients_tokens(correct_file_with_master_key)
    client_token_is_allowed(clients_tokens, 'centre', '9bf5')
    clients_tokens = get_clients_tokens(correct_file_without_master_key)
    client_token_is_allowed(clients_tokens, 'centre', '9bf5')
示例#7
0
文件: utils_test.py 项目: dvdn/Chaos
def test_client_with_wrong_token_is_not_allowed():
    clients_tokens = get_clients_tokens(correct_file_with_master_key)
    client_token_is_allowed(clients_tokens, 'transilien', '1')
    clients_tokens = get_clients_tokens(correct_file_without_master_key)
    client_token_is_allowed(clients_tokens, 'transilien', '1')
示例#8
0
文件: utils_test.py 项目: dvdn/Chaos
def test_client_with_master_token_is_allowed():
    clients_tokens = get_clients_tokens(correct_file_with_master_key)
    assert client_token_is_allowed(clients_tokens, 'transilien', '42')
    assert client_token_is_allowed(clients_tokens, 'another_one', '42')
示例#9
0
文件: utils_test.py 项目: dvdn/Chaos
def test_client_with_second_token_is_allowed():
    clients_tokens = get_clients_tokens(correct_file_with_master_key)
    assert client_token_is_allowed(clients_tokens, 'transilien', '9bf6')
    clients_tokens = get_clients_tokens(correct_file_without_master_key)
    assert client_token_is_allowed(clients_tokens, 'transilien', '9bf6')
示例#10
0
文件: utils_test.py 项目: dvdn/Chaos
def test_client_token_file_doesnt_exist():
    assert get_clients_tokens(wrong_file) == None