File size: 782 Bytes
0ad74ed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import pytest

from gradio import Interface, networking


@pytest.mark.flaky
def test_setup_tunnel():
    io = Interface(lambda x: x, "number", "number")
    io.launch(show_error=True, prevent_thread_lock=True)
    share_url = networking.setup_tunnel(
        io.server_name, io.server_port, io.share_token, io.share_server_address
    )
    assert isinstance(share_url, str)


@pytest.mark.flaky
def test_setup_custom_tunnel():
    io = Interface(lambda x: x, "number", "number")
    io.launch(
        show_error=True,
        prevent_thread_lock=True,
        share_server_address="my-gpt-wrapper.com:7000",
    )
    share_url = networking.setup_tunnel(
        io.server_name, io.server_port, io.share_token, io.share_server_address
    )
    assert isinstance(share_url, str)