<s> """<STR_LIT>""" <EOL> import datetime <EOL> import responses <EOL> import googlemaps <EOL> import test as _test <EOL> class ElevationTest ( _test . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . key = '<STR_LIT>' <EOL> self . client = googlemaps . Client ( self . key ) <EOL> @ responses . activate <EOL> def test_elevation_single ( self ) : <EOL> responses . add ( responses . GET , <EOL> '<STR_LIT>' , <EOL> body = '<STR_LIT>' , <EOL> status = <NUM_LIT:200> , <EOL> content_type = '<STR_LIT:application/json>' ) <EOL> results = self . client . elevation ( ( <NUM_LIT> , - <NUM_LIT> ) ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( responses . calls ) ) <EOL> self . assertURLEqual ( '<STR_LIT>' <EOL> '<STR_LIT>' % self . key , <EOL> responses . calls [ <NUM_LIT:0> ] . request . url ) <EOL> @ responses . activate <EOL> def test_elevation_single_list ( self ) : <EOL> responses . add ( responses . GET , <EOL> '<STR_LIT>' , <EOL> body = '<STR_LIT>' , <EOL> status = <NUM_LIT:200> , <EOL> content_type = '<STR_LIT:application/json>' ) <EOL> results = self . client . elevation ( [ ( <NUM_LIT> , - <NUM_LIT> ) ] ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( responses . calls ) ) <EOL> self . assertURLEqual ( '<STR_LIT>' <EOL> '<STR_LIT>' % self . key , <EOL> responses . calls [ <NUM_LIT:0> ] . request . url ) <EOL> @ responses . activate <EOL> def test_elevation_multiple ( self ) : <EOL> responses . add ( responses . GET , <EOL> '<STR_LIT>' , <EOL> body = '<STR_LIT>' , <EOL> status = <NUM_LIT:200> , <EOL> content_type = '<STR_LIT:application/json>' ) <EOL> locations = [ ( <NUM_LIT> , - <NUM_LIT> ) , ( - <NUM_LIT> , <NUM_LIT> ) ] <EOL> results = self . client . elevation ( locations ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( responses . calls ) ) <EOL> self . assertURLEqual ( '<STR_LIT>' <EOL> '<STR_LIT>' % self . key , <EOL> responses . calls [ <NUM_LIT:0> ] . request . url ) <EOL> def test_elevation_along_path_single ( self ) : <EOL> with self . assertRaises ( googlemaps . exceptions . ApiError ) : <EOL> results = self . client . elevation_along_path ( <EOL> [ ( <NUM_LIT> , - <NUM_LIT> ) ] , <NUM_LIT:5> ) <EOL> @ responses . activate <EOL> def test_elevation_along_path ( self ) : <EOL> responses . add ( responses . GET , <EOL> '<STR_LIT>' , <EOL> body = '<STR_LIT>' , <EOL> status = <NUM_LIT:200> , <EOL> content_type = '<STR_LIT:application/json>' ) <EOL> path = [ ( <NUM_LIT> , - <NUM_LIT> ) , ( - <NUM_LIT> , <NUM_LIT> ) ] <EOL> results = self . client . elevation_along_path ( path , <NUM_LIT:5> ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( responses . calls ) ) <EOL> self . assertURLEqual ( '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' % self . key , <EOL> responses . calls [ <NUM_LIT:0> ] . request . url ) <EOL> @ responses . activate <EOL> def test_short_latlng ( self ) : <EOL> responses . add ( responses . GET , <EOL> '<STR_LIT>' , <EOL> body = '<STR_LIT>' , <EOL> status = <NUM_LIT:200> , <EOL> content_type = '<STR_LIT:application/json>' ) <EOL> results = self . client . elevation ( ( <NUM_LIT> , - <NUM_LIT> ) ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( responses . calls ) ) <EOL> self . assertURLEqual ( '<STR_LIT>' <EOL> '<STR_LIT>' % self . key , <EOL> responses . calls [ <NUM_LIT:0> ] . request . url ) </s>
