Commits

Joe Heck committed 126040e

pep8 fixes

  • Participants
  • Parent commits 8834d5c
  • Branches mobileui

Comments (0)

Files changed (1)

File eyeswebapp/util/tests/nagios.py

         # now check the output...
         result_dict = result.decoded
         self.assertTrue(result_dict)
-        self.assertTrue(result_dict.has_key('human'))
-        self.assertTrue(result_dict.has_key('pl'))
-        self.assertTrue(result_dict.has_key('rta'))
+        self.assertTrue('human' in result_dict)
+        self.assertTrue('pl' in result_dict)
+        self.assertTrue('rta' in result_dict)
         self.assertTrue(result_dict['human'].startswith('PING OK'))
-        self.assertTrue(result_dict['pl'].has_key('label'))
+        self.assertTrue('label' in result_dict['pl'])
         self.assertEquals(result_dict['pl']['label'], 'pl')
         self.assertEquals(result_dict['pl']['value'], '0')
         self.assertEquals(result_dict['pl']['UOM'], '%')
-        self.assertTrue(result_dict['rta'].has_key('label'))
+        self.assertTrue('label' in result_dict['rta'])
         self.assertEquals(result_dict['rta']['label'], 'rta')
         self.assertEquals(result_dict['rta']['UOM'], 'ms')
 
         self.assertEqual(mon_result.error, "")
         decoded_dict = mon_result.decoded
         self.assertTrue(decoded_dict, "decoded data is null - expected a dictionary")
-        self.assertTrue(decoded_dict.has_key('human'))
-        self.assertTrue(decoded_dict.has_key('size'))
-        self.assertTrue(decoded_dict.has_key('time'))
+        self.assertTrue('human' in decoded_dict)
+        self.assertTrue('size' in decoded_dict)
+        self.assertTrue('time' in decoded_dict)
         self.assertTrue(decoded_dict['human'].startswith('HTTP OK'))
-        self.assertTrue(decoded_dict['size'].has_key('label'))
+        self.assertTrue('label' in decoded_dict['size'])
         self.assertEquals(decoded_dict['size']['label'], 'size')
         self.assertEquals(decoded_dict['size']['UOM'], 'B')
-        self.assertTrue(decoded_dict['time'].has_key('label'))
+        self.assertTrue('label' in decoded_dict['time'])
         self.assertEquals(decoded_dict['time']['UOM'], 's')
 
     def test_functional_checkhttp2(self):