예제 #1
0
def test_connect_parallel():
    with mock.patch("sys.argv", ["openpyn", "de", "--test"]):
        assert openpyn.main() == 0
예제 #2
0
def test_list():
    with mock.patch("sys.argv", ["openpyn", "-l"]):
        assert openpyn.main() == 0
예제 #3
0
def test_connect_max_load():
    with mock.patch("sys.argv", ["openpyn", "au", "-m", "50", "--test"]):
        assert openpyn.main() == 0
예제 #4
0
def test_connect_top_servers():
    with mock.patch("sys.argv", ["openpyn", "au", "-t", "5", "--test"]):
        assert openpyn.main() == 0
예제 #5
0
def test_connect_country_name():
    with mock.patch("sys.argv", ["openpyn", "australia", "--test"]):
        assert openpyn.main() == 0
예제 #6
0
def test_connect_country_code_arg():
    with mock.patch("sys.argv", ["openpyn", "-c", "au", "--test"]):
        assert openpyn.main() == 0
예제 #7
0
def test_list_country_area_state_p2p():
    with mock.patch(
            "sys.argv",
        ["openpyn", "-l", "au", "--area", "south australia", "--p2p"]):
        assert openpyn.main() == 0
예제 #8
0
def test_connect_country_location():
    with mock.patch(
            "sys.argv",
        ["openpyn", "au", "--location", "-37.813938", "144.963425", "--test"]):
        assert openpyn.main() == 0
예제 #9
0
def test_connect_top_servers():
    with mock.patch('sys.argv', ['openpyn', 'au', '-t', '5', '--test']):
        assert openpyn.main() == 0
예제 #10
0
def test_connect_pings():
    with mock.patch('sys.argv', ['openpyn', 'au', '-p', '5', '--test']):
        assert openpyn.main() == 0
예제 #11
0
def test_connect_max_load():
    with mock.patch('sys.argv', ['openpyn', 'au', '-m', '50', '--test']):
        assert openpyn.main() == 0
예제 #12
0
def test_connect_country_code_arg():
    with mock.patch('sys.argv', ['openpyn', '-c', 'au', '--test']):
        assert openpyn.main() == 0
예제 #13
0
def test_connect_country_name():
    with mock.patch('sys.argv', ['openpyn', 'australia', '--test']):
        assert openpyn.main() == 0
예제 #14
0
def test_list_country_area_state_p2p():
    with mock.patch('sys.argv',
                    ['openpyn', '-l', 'au', '--area', 'sa', '--p2p']):
        assert openpyn.main() == 0
예제 #15
0
def test_list_tor():
    with mock.patch('sys.argv', ['openpyn', '-l', '--tor']):
        assert openpyn.main() == 0