Beispiel #1
0
 def test_patch_switch_machine(self):
     switch.add_switch_machine(
         1,
         mac='28:6e:d4:46:c4:25',
         port='1',
         user=self.user_object,
     )
     switch.patch_switch_machine(
         1,
         1,
         user=self.user_object,
         tag={
             'patched_tag': 'test_patched_tag'
         }
     )
     switch_patch_switch_machine = switch.list_switch_machines(
         1,
         user=self.user_object,
     )
     expected = {'tag': {
         'patched_tag': 'test_patched_tag'}
     }
     self.assertTrue(
         all(item in switch_patch_switch_machine[0].items()
             for item in expected.items())
     )
Beispiel #2
0
def patch_switch_machine():
    """patch switch machine."""
    data = _get_request_data()
    return utils.make_json_response(
        200,
        switch_api.patch_switch_machine(
            current_user, switch_id, machine_id, **data
        )
    )
 def test_patch_switch_machine(self):
     switch.add_switch_machine(
         1,
         mac='28:6e:d4:46:c4:25',
         port='1',
         user=self.user_object,
     )
     switch.patch_switch_machine(1,
                                 1,
                                 user=self.user_object,
                                 tag={'patched_tag': 'test_patched_tag'})
     switch_patch_switch_machine = switch.list_switch_machines(
         1,
         user=self.user_object,
     )
     expected = {'tag': {'patched_tag': 'test_patched_tag'}}
     self.assertTrue(
         all(item in switch_patch_switch_machine[0].items()
             for item in expected.items()))
Beispiel #4
0
 def test_pathc_switch_machine(self):
     switch.add_switch_machine(
         self.user_object,
         1,
         mac='28:6e:d4:46:c4:25',
         port='1'
     )
     switch.patch_switch_machine(
         self.user_object,
         1,
         1,
         patched_tag={
             'patched_tag': 'test_patched_tag'
         }
     )
     switch_patch_switch_machine = switch.list_switch_machines(
         self.user_object,
         1
     )
     expected = {'patched_tag': 'test_patched_tag'}
     self.assertTrue(
         item in switch_patch_switch_machine[0].items()
         for item in expected.items()
     )