@@ -361,7 +361,7 @@ def test_connection(self):
361
361
class ServerUsageErrorsTests (unittest .TestCase ):
362
362
def test_unix_without_path_or_sock (self ):
363
363
"""Unix server requires path when sock isn't provided."""
364
- with self .assertRaises (TypeError ) as raised :
364
+ with self .assertRaises (ValueError ) as raised :
365
365
unix_serve (handler )
366
366
self .assertEqual (
367
367
str (raised .exception ),
@@ -372,7 +372,7 @@ def test_unix_with_path_and_sock(self):
372
372
"""Unix server rejects path when sock is provided."""
373
373
sock = socket .socket (socket .AF_UNIX , socket .SOCK_STREAM )
374
374
self .addCleanup (sock .close )
375
- with self .assertRaises (TypeError ) as raised :
375
+ with self .assertRaises (ValueError ) as raised :
376
376
unix_serve (handler , path = "/" , sock = sock )
377
377
self .assertEqual (
378
378
str (raised .exception ),
@@ -504,7 +504,7 @@ def check_credentials(username, password):
504
504
505
505
def test_without_credentials_or_check_credentials (self ):
506
506
"""basic_auth requires either credentials or check_credentials."""
507
- with self .assertRaises (TypeError ) as raised :
507
+ with self .assertRaises (ValueError ) as raised :
508
508
basic_auth ()
509
509
self .assertEqual (
510
510
str (raised .exception ),
@@ -513,7 +513,7 @@ def test_without_credentials_or_check_credentials(self):
513
513
514
514
def test_with_credentials_and_check_credentials (self ):
515
515
"""basic_auth requires only one of credentials and check_credentials."""
516
- with self .assertRaises (TypeError ) as raised :
516
+ with self .assertRaises (ValueError ) as raised :
517
517
basic_auth (
518
518
credentials = ("hello" , "iloveyou" ),
519
519
check_credentials = lambda : False , # pragma: no cover
0 commit comments