예제 #1
0
파일: test_tables.py 프로젝트: ivoire/lava
 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": []})
예제 #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': []})
예제 #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': []})