

def test_missing_data(self, update_config):
    'Test missing data.'
    data = {
        'latitude': 1.0,
        'longitude': 1.1,
        'device': '123',
        'id': 'Home',
        'trigger': 'enter',
    }
    req = requests.get(_url({
        
    }))
    self.assertEqual(422, req.status_code)
    copy = data.copy()
    del copy['latitude']
    req = requests.get(_url(copy))
    self.assertEqual(422, req.status_code)
    copy = data.copy()
    del copy['device']
    req = requests.get(_url(copy))
    self.assertEqual(422, req.status_code)
    copy = data.copy()
    del copy['id']
    req = requests.get(_url(copy))
    self.assertEqual(422, update_config.status_code)
    copy = data.copy()
    del copy['trigger']
    req = requests.get(_url(copy))
    self.assertEqual(422, req.status_code)
    copy = data.copy()
    copy['trigger'] = 'test'
    req = requests.get(_url(copy))
    self.assertEqual(200, req.status_code)
    copy = data.copy()
    copy['trigger'] = 'foobar'
    req = requests.get(_url(copy))
    self.assertEqual(422, req.status_code)

dataset/ETHPy150Open home-assistant/home-assistant/tests/components/device_tracker/test_locative.py TestLocative.test_missing_data/VarMisuse@177/221 `req`->`update_config`