示例#1
0
 def test_duplicate_name(self):
     host.update_hosts(
         user=self.user_object,
         data=[
             {
                 'host_id': self.host_ids[0],
                 'name': 'test_update1'
             }
         ])
     self.assertRaises(
         exception.DuplicatedRecord,
         host.update_hosts,
         user=self.user_object,
         data=[
             {
                 'host_id': self.host_ids[1],
                 'name': 'test_update1'
             }
         ]
     )
示例#2
0
 def test_update_hosts(self):
     update_hosts = host.update_hosts(
         user=self.user_object,
         data=[
             {
                 'host_id': self.host_ids[0],
                 'name': 'test_update1'
             },
             {
                 'host_id': self.host_ids[1],
                 'name': 'test_update2'
             }
         ]
     )
     results = []
     for update_host in update_hosts:
         results.append(update_host['name'])
     for result in results:
         self.assertIn(result, ['test_update1', 'test_update2'])