Beispiel #1
0
 def test_data(self, *args):
     view = ClusterInstanceDetailView(self.instance, Mock())
     result = view.data()
     self.assertEqual(self.instance.created, result["instance"]["created"])
     self.assertEqual(self.instance.updated, result["instance"]["updated"])
     self.assertEqual(self.instance.datastore_version.name, result["instance"]["datastore"]["version"])
     self.assertEqual(self.instance.hostname, result["instance"]["hostname"])
     self.assertNotIn("ip", result["instance"])
Beispiel #2
0
 def test_data(self, *args):
     view = ClusterInstanceDetailView(self.instance, Mock())
     result = view.data()
     self.assertEqual(self.instance.created, result['instance']['created'])
     self.assertEqual(self.instance.updated, result['instance']['updated'])
     self.assertEqual(self.instance.datastore_version.name,
                      result['instance']['datastore']['version'])
     self.assertEqual(self.instance.hostname,
                      result['instance']['hostname'])
     self.assertNotIn('ip', result['instance'])
Beispiel #3
0
 def test_data_ip(self, *args):
     self.instance.hostname = None
     view = ClusterInstanceDetailView(self.instance, self.req)
     result = view.data()
     self.assertEqual(self.instance.created, result['instance']['created'])
     self.assertEqual(self.instance.updated, result['instance']['updated'])
     self.assertEqual(self.instance.datastore_version.name,
                      result['instance']['datastore']['version'])
     self.assertNotIn('hostname', result['instance'])
     self.assertEqual([self.ip], result['instance']['ip'])