Example #1
0
 def test_device_table(self):
     logging.debug("Testing with a View derived from LavaView")
     view = TestDeviceView(None)
     table = DeviceTable(view.get_table_data())
     self.assertEqual(table.prepare_search_data(view), {"search": []})
     self.assertEqual(table.prepare_terms_data(view), {"terms": {}})
     self.assertEqual(table.prepare_times_data(view), {"times": []})
Example #2
0
 def test_device_table(self):
     logging.debug("Testing with a View derived from LavaView")
     view = TestDeviceView(None)
     table = DeviceTable(view.get_table_data())
     self.assertEqual(table.prepare_search_data(view), {'search': []})
     self.assertEqual(table.prepare_terms_data(view), {'terms': {}})
     self.assertEqual(table.prepare_times_data(view), {'times': []})
Example #3
0
 def test_device_table_model(self):
     view = TestDeviceView(None, model=Device, table_class=DeviceTable)
     table = DeviceTable(view.get_table_data())
     self.assertEqual(
         table.prepare_search_data(view),
         {"search": ["device_type", "health", u"Hostname", "state", "tags"]},
     )
     self.assertEqual(table.prepare_terms_data(view), {"terms": {}})
     self.assertEqual(table.prepare_times_data(view), {"times": []})
 def test_device_table_model(self):
     view = TestDeviceView(None, model=Device, table_class=DeviceTable)
     table = DeviceTable(view.get_table_data())
     self.assertEqual(table.prepare_search_data(view),
                      {'search': ['device_type',
                                  'health_status',
                                  u'Hostname',
                                  'restrictions',
                                  'status']})
     self.assertEqual(table.prepare_terms_data(view), {'terms': {}})
     self.assertEqual(table.prepare_times_data(view), {'times': []})