Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: default url param in app.start #160

Merged
merged 1 commit into from
Feb 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions integration_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ def session():
del os.environ["ROBYN_URL"]


@pytest.fixture
def default_session():
subprocess.call(["yes | freeport 5000"], shell=True)
current_file_path = pathlib.Path(__file__).parent.resolve()
base_routes = os.path.join(current_file_path, "./base_routes.py")
process = subprocess.Popen(["python3", base_routes])
time.sleep(5)
yield
process.terminate()


@pytest.fixture
def global_session():
os.environ["ROBYN_URL"] = "0.0.0.0"
Expand Down
6 changes: 6 additions & 0 deletions integration_tests/test_base_url.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import requests


def test_default_url_index_request(default_session):
BASE_URL = "http://127.0.0.1:5000"
res = requests.get(f"{BASE_URL}")
assert(res.status_code == 200)


def test_local_index_request(session):
BASE_URL = "http://127.0.0.1:5000"
res = requests.get(f"{BASE_URL}")
Expand Down
2 changes: 1 addition & 1 deletion robyn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def startup_handler(self, handler):
def shutdown_handler(self, handler):
self._add_event_handler(Events.SHUTDOWN, handler)

def start(self, url="128.0.0.1", port=5000):
def start(self, url="127.0.0.1", port=5000):
"""
[Starts the server]

Expand Down