@@ -540,48 +540,49 @@ def test_get(self):
540540 os .chmod (self .tempdir , 0o755 )
541541
542542 def test_range_get (self ):
543- response = self .request (self .base_url + '/test' )
543+ route = self .base_url + '/test'
544+ response = self .request (route )
544545 self .assertEqual (response .getheader ('accept-ranges' ), 'bytes' )
545546 self .check_status_and_reason (response , HTTPStatus .OK , data = self .data )
546547
547548 # valid ranges
548- response = self .request (self . base_url + '/test' , headers = {'Range' : 'bytes=3-12' })
549+ response = self .request (route , headers = {'Range' : 'bytes=3-12' })
549550 self .assertEqual (response .getheader ('content-range' ), 'bytes 3-12/30' )
550551 self .assertEqual (response .getheader ('content-length' ), '10' )
551552 self .check_status_and_reason (response , HTTPStatus .PARTIAL_CONTENT , data = self .data [3 :13 ])
552553
553- response = self .request (self . base_url + '/test' , headers = {'Range' : 'bytes=3-' })
554+ response = self .request (route , headers = {'Range' : 'bytes=3-' })
554555 self .assertEqual (response .getheader ('content-range' ), 'bytes 3-29/30' )
555556 self .assertEqual (response .getheader ('content-length' ), '27' )
556557 self .check_status_and_reason (response , HTTPStatus .PARTIAL_CONTENT , data = self .data [3 :])
557558
558- response = self .request (self . base_url + '/test' , headers = {'Range' : 'bytes=-5' })
559+ response = self .request (route , headers = {'Range' : 'bytes=-5' })
559560 self .assertEqual (response .getheader ('content-range' ), 'bytes 25-29/30' )
560561 self .assertEqual (response .getheader ('content-length' ), '5' )
561562 self .check_status_and_reason (response , HTTPStatus .PARTIAL_CONTENT , data = self .data [25 :])
562563
563- response = self .request (self . base_url + '/test' , headers = {'Range' : 'bytes=29-29' })
564+ response = self .request (route , headers = {'Range' : 'bytes=29-29' })
564565 self .assertEqual (response .getheader ('content-range' ), 'bytes 29-29/30' )
565566 self .assertEqual (response .getheader ('content-length' ), '1' )
566567 self .check_status_and_reason (response , HTTPStatus .PARTIAL_CONTENT , data = self .data [29 :])
567568
568569 # end > file size
569- response = self .request (self . base_url + '/test' , headers = {'Range' : 'bytes=25-100' })
570+ response = self .request (route , headers = {'Range' : 'bytes=25-100' })
570571 self .assertEqual (response .getheader ('content-range' ), 'bytes 25-29/30' )
571572 self .assertEqual (response .getheader ('content-length' ), '5' )
572573 self .check_status_and_reason (response , HTTPStatus .PARTIAL_CONTENT , data = self .data [25 :])
573574
574575 # invalid ranges
575- response = self .request (self . base_url + '/test' , headers = {'Range' : 'bytes=100-200' })
576+ response = self .request (route , headers = {'Range' : 'bytes=100-200' })
576577 self .check_status_and_reason (response , HTTPStatus .REQUESTED_RANGE_NOT_SATISFIABLE )
577578
578- response = self .request (self . base_url + '/test' , headers = {'Range' : 'bytes=4-3' })
579+ response = self .request (route , headers = {'Range' : 'bytes=4-3' })
579580 self .check_status_and_reason (response , HTTPStatus .OK , data = self .data )
580581
581- response = self .request (self . base_url + '/test' , headers = {'Range' : 'bytes=wrong format' })
582+ response = self .request (route , headers = {'Range' : 'bytes=wrong format' })
582583 self .check_status_and_reason (response , HTTPStatus .OK , data = self .data )
583584
584- response = self .request (self . base_url + '/test' , headers = {'Range' : 'bytes=-' })
585+ response = self .request (route , headers = {'Range' : 'bytes=-' })
585586 self .check_status_and_reason (response , HTTPStatus .OK , data = self .data )
586587
587588 def test_head (self ):
0 commit comments