Exemplo n.º 1
0
 def test_patch_machine(self):
     switch.add_switch_machine(
         1,
         mac='28:6e:d4:46:c4:25',
         port='1',
         user=self.user_object,
     )
     machine.patch_machine(1,
                           user=self.user_object,
                           tag={'patched_tag': 'test'})
     patch_machine = machine.list_machines(self.user_object)
     expected = {'tag': {'patched_tag': 'test'}}
     self.assertTrue(
         all(item in patch_machine[0].items() for item in expected.items()))
Exemplo n.º 2
0
 def test_patch_machine(self):
     switch.add_switch_machine(
         1,
         mac='28:6e:d4:46:c4:25',
         port='1',
         user=self.user_object,
     )
     machine.patch_machine(
         1,
         user=self.user_object,
         tag={'patched_tag': 'test'}
     )
     patch_machine = machine.list_machines(self.user_object)
     expected = {'tag': {'patched_tag': 'test'}}
     self.assertTrue(
         all(item in patch_machine[0].items() for item in expected.items())
     )
Exemplo n.º 3
0
def patch_machine():
    """patch machine."""
    data = _get_request_data()
    return utils.make_json_response(
        200,
        machine_api.patch_machine(
            current_user, machine_id, **data
        )
    )