Add geolocation tests
This commit is contained in:
		
							parent
							
								
									16f4025179
								
							
						
					
					
						commit
						e4043a04b8
					
				@ -101,6 +101,16 @@ def test_lookup_with_invalid_location():
 | 
				
			|||||||
    res = geolocation.lookup(location='foobar dne')
 | 
					    res = geolocation.lookup(location='foobar dne')
 | 
				
			||||||
    assert res is None, res
 | 
					    assert res is None, res
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def test_lookup_with_invalid_location():
 | 
				
			||||||
 | 
					    res = geolocation.lookup(location='foobar dne')
 | 
				
			||||||
 | 
					    assert res is None, res
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def test_lookup_with_valid_key():
 | 
				
			||||||
 | 
					    res = geolocation.lookup(location='Sunnyvale, CA')
 | 
				
			||||||
 | 
					    latLng = res['results'][0]['locations'][0]['latLng']
 | 
				
			||||||
 | 
					    assert latLng['lat'] == 37.36883, latLng
 | 
				
			||||||
 | 
					    assert latLng['lng'] == -122.03635, latLng
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@mock.patch('elodie.geolocation.__KEY__', 'invalid_key')
 | 
					@mock.patch('elodie.geolocation.__KEY__', 'invalid_key')
 | 
				
			||||||
def test_lookup_with_invalid_key():
 | 
					def test_lookup_with_invalid_key():
 | 
				
			||||||
    res = geolocation.lookup(location='Sunnyvale, CA')
 | 
					    res = geolocation.lookup(location='Sunnyvale, CA')
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user