File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed
Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ def __post_init__(self) -> None:
2121 if self .headers is not None and not isinstance (self .headers , dict ):
2222 raise HyperbrowserError ("headers must be a dictionary of string pairs" )
2323 self .api_key = self .api_key .strip ()
24+ if not self .api_key :
25+ raise HyperbrowserError ("api_key must not be empty" )
2426 self .base_url = self .base_url .strip ().rstrip ("/" )
2527 if not self .base_url :
2628 raise HyperbrowserError ("base_url must not be empty" )
Original file line number Diff line number Diff line change @@ -64,6 +64,9 @@ def test_client_config_rejects_non_string_values():
6464 with pytest .raises (HyperbrowserError , match = "headers must be a dictionary" ):
6565 ClientConfig (api_key = "test-key" , headers = "x=1" ) # type: ignore[arg-type]
6666
67+ with pytest .raises (HyperbrowserError , match = "api_key must not be empty" ):
68+ ClientConfig (api_key = " " )
69+
6770
6871def test_client_config_rejects_empty_or_invalid_base_url ():
6972 with pytest .raises (HyperbrowserError , match = "base_url must not be empty" ):
You can’t perform that action at this time.
0 commit comments