<s> import os . path <EOL> import pycurl <EOL> import sys <EOL> import unittest <EOL> class UnsetRangeTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . curl = pycurl . Curl ( ) <EOL> def tearDown ( self ) : <EOL> self . curl . close ( ) <EOL> def test_unset_range ( self ) : <EOL> def write_cb ( data ) : <EOL> self . read += len ( data ) <EOL> return None <EOL> self . read = <NUM_LIT:0> <EOL> self . curl . setopt ( pycurl . URL , '<STR_LIT>' + os . path . abspath ( sys . argv [ <NUM_LIT:0> ] ) ) <EOL> self . curl . setopt ( pycurl . WRITEFUNCTION , write_cb ) <EOL> self . curl . setopt ( pycurl . RANGE , '<STR_LIT>' ) <EOL> self . curl . perform ( ) <EOL> assert <NUM_LIT:10> == self . read <EOL> self . read = <NUM_LIT:0> <EOL> self . curl . perform ( ) <EOL> assert <NUM_LIT:10> == self . read <EOL> self . read = <NUM_LIT:0> <EOL> self . curl . unsetopt ( pycurl . RANGE ) <EOL> self . curl . perform ( ) <EOL> assert <NUM_LIT:10> < self . read <EOL> self . read = <NUM_LIT:0> <EOL> self . curl . setopt ( pycurl . RANGE , '<STR_LIT>' ) <EOL> self . curl . perform ( ) <EOL> assert <NUM_LIT:10> == self . read <EOL> self . read = <NUM_LIT:0> <EOL> self . curl . setopt ( pycurl . RANGE , None ) <EOL> self . curl . perform ( ) <EOL> assert <NUM_LIT:10> < self . read </s>
