mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-06 12:55:05 -05:00
22 lines
500 B
Python
22 lines
500 B
Python
import pytest
|
|
|
|
from backend.util.request import validate_url
|
|
|
|
|
|
def test_validate_url():
|
|
with pytest.raises(ValueError):
|
|
validate_url("localhost", [])
|
|
|
|
with pytest.raises(ValueError):
|
|
validate_url("192.168.1.1", [])
|
|
|
|
with pytest.raises(ValueError):
|
|
validate_url("127.0.0.1", [])
|
|
|
|
with pytest.raises(ValueError):
|
|
validate_url("0.0.0.0", [])
|
|
|
|
validate_url("google.com", [])
|
|
validate_url("github.com", [])
|
|
validate_url("http://github.com", [])
|