示例#1
0
 def test_progress_update(self, client):
     rprogress = randint(10, 100)
     msg = self.create_msg(progress=rprogress,
                           instance=self.vm.backend_vm_id)
     update_build_progress(client, msg)
     self.assertTrue(client.basic_ack.called)
     vm = self.get_db_vm()
     self.assertEqual(vm.buildpercentage, rprogress)
示例#2
0
 def test_progress_update(self, client):
     rprogress = randint(10, 100)
     msg = self.create_msg(progress=rprogress,
                           instance=self.vm.backend_vm_id)
     update_build_progress(client, msg)
     self.assertTrue(client.basic_ack.called)
     vm = self.get_db_vm()
     self.assertEqual(vm.buildpercentage, rprogress)
示例#3
0
 def test_invalid_value(self, client):
     old = self.vm.buildpercentage
     for rprogress in [0, -1, 'a']:
         msg = self.create_msg(progress=rprogress,
                               instance=self.vm.backend_vm_id)
         update_build_progress(client, msg)
         self.assertTrue(client.basic_ack.called)
         vm = self.get_db_vm()
         self.assertEqual(vm.buildpercentage, old)
示例#4
0
 def test_invalid_value(self, client):
     old = self.vm.buildpercentage
     for rprogress in [0, -1, 'a']:
         msg = self.create_msg(progress=rprogress,
                               instance=self.vm.backend_vm_id)
         update_build_progress(client, msg)
         self.assertTrue(client.basic_ack.called)
         vm = self.get_db_vm()
         self.assertEqual(vm.buildpercentage, old)
示例#5
0
 def test_wrong_type(self, client):
     msg = self.create_msg(type="WRONG_TYPE")
     update_build_progress(client, msg)
     self.assertTrue(client.basic_nack.called)
示例#6
0
 def test_missing_instance(self, client):
     msg = self.create_msg(instance='foo')
     update_build_progress(client, msg)
     self.assertTrue(client.basic_ack.called)
示例#7
0
 def test_unhandled_exception(self, client):
     update_build_progress(client, {})
     client.basic_reject.assert_called_once()
示例#8
0
 def test_missing_attribute(self, client):
     update_build_progress(client, json.dumps({'body': {}}))
     self.assertTrue(client.basic_reject.called)
示例#9
0
 def test_missing_instance(self, client):
     msg = self.create_msg(instance='foo')
     update_build_progress(client, msg)
     client.basic_nack.assert_called_once()
示例#10
0
 def test_missing_instance(self, client):
     msg = self.create_msg(instance='foo')
     update_build_progress(client, msg)
     self.assertTrue(client.basic_ack.called)
示例#11
0
 def test_unhandled_exception(self, client):
     update_build_progress(client, {})
     client.basic_reject.assert_called_once()
示例#12
0
 def test_missing_attribute(self, client):
     update_build_progress(client, json.dumps({'body': {}}))
     self.assertTrue(client.basic_reject.called)
示例#13
0
文件: tests.py 项目: cstavr/synnefo
 def test_wrong_type(self, client):
     msg = self.create_msg(type="WRONG_TYPE")
     update_build_progress(client, msg)
     client.basic_ack.assert_called_once()
示例#14
0
文件: tests.py 项目: cstavr/synnefo
 def test_missing_instance(self, client):
     msg = self.create_msg(instance='foo')
     update_build_progress(client, msg)
     client.basic_nack.assert_called_once()
示例#15
0
文件: tests.py 项目: cstavr/synnefo
 def test_missing_attribute(self, client):
     update_build_progress(client, json.dumps({'body': {}}))
     client.basic_nack.assert_called_once()
示例#16
0
 def test_wrong_type(self, client):
     msg = self.create_msg(type="WRONG_TYPE")
     update_build_progress(client, msg)
     client.basic_ack.assert_called_once()
示例#17
0
 def test_wrong_type(self, client):
     msg = self.create_msg(type="WRONG_TYPE")
     update_build_progress(client, msg)
     self.assertTrue(client.basic_nack.called)
示例#18
0
 def test_missing_attribute(self, client):
     update_build_progress(client, json.dumps({'body': {}}))
     client.basic_nack.assert_called_once()