Пример #1
0
 def test_update_machine(self):
     switch.add_switch_machine(
         self.user_object,
         1,
         mac='28:6e:d4:46:c4:25',
         port='1'
     )
     machine.update_machine(
         self.user_object,
         1,
         tag='test'
     )
     update_machine = machine.list_machines(self.user_object)
     expected = {'tag': 'test'}
     self.assertTrue(
         item in update_machine[0].items() for item in expected.items()
     )
Пример #2
0
def update_machine():
    """update machine."""
    data = _get_request_data()
    return utils.make_json_response(
        200,
        machine_api.update_machine(
            current_user, machine_id, **data
        )
    )
Пример #3
0
 def test_update_machine(self):
     switch.add_switch_machine(
         1,
         mac='28:6e:d4:46:c4:25',
         port='1',
         user=self.user_object,
     )
     machine.update_machine(
         1,
         tag='test',
         user=self.user_object,
     )
     update_machine = machine.list_machines(self.user_object)
     expected = {
         'id': 1,
         'mac': '28:6e:d4:46:c4:25',
         'tag': 'test',
         'switch_ip': '0.0.0.0',
         'port': '1'
     }
     self.assertTrue(
         all(item in update_machine[0].items()
             for item in expected.items()))
Пример #4
0
 def test_update_machine(self):
     switch.add_switch_machine(
         1,
         mac='28:6e:d4:46:c4:25',
         port='1',
         user=self.user_object,
     )
     machine.update_machine(
         1,
         tag='test',
         user=self.user_object,
     )
     update_machine = machine.list_machines(self.user_object)
     expected = {
         'id': 1,
         'mac': '28:6e:d4:46:c4:25',
         'tag': 'test',
         'switch_ip': '0.0.0.0',
         'port': '1'
     }
     self.assertTrue(
         all(item in update_machine[0].items() for item in expected.items())
     )