Add unit tests (#133)
* Add initial test & add pipeline * Add very basic YAML config tests * Add coverage reporting * Add some webserver & template loading tests * Add test cases for the helpers * Implement initial OIDC server tests * Test codestore & discovery checker * Test basics of the config flow * Add test for the HA auth provider * Cleaned up tests & test injection
This commit is contained in:
committed by
GitHub
parent
5714e844a7
commit
404d2451df
@@ -10,7 +10,7 @@ def validate_url(url: str) -> bool:
|
||||
try:
|
||||
parsed = urlparse(url.strip())
|
||||
return bool(parsed.scheme in ("http", "https") and parsed.netloc)
|
||||
except (ValueError, TypeError):
|
||||
except (ValueError, TypeError, AttributeError):
|
||||
return False
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ def validate_discovery_url(url: str) -> bool:
|
||||
and parsed.netloc
|
||||
and parsed.path.endswith("/.well-known/openid-configuration")
|
||||
)
|
||||
except (ValueError, TypeError):
|
||||
except (ValueError, TypeError, AttributeError):
|
||||
return False
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user