Example #1
0
 def test_patch_switch(self):
     switch.patch_switch(1,
                         user=self.user_object,
                         credentials={
                             'version': '2c',
                             'community': 'public'
                         })
     patch_switch = switch.get_switch(
         1,
         user=self.user_object,
     )
     expected = {'credentials': {'version': '2c', 'community': 'public'}}
     self.assertTrue(
         all(item in patch_switch.items() for item in expected.items()))
Example #2
0
def patch_switch(switch_id):
    """update switch."""
    data = _get_request_data()
    return utils.make_json_response(
        200,
        switch_api.patch_switch(current_user, switch_id, **data)
    )
Example #3
0
 def test_patch_switch(self):
     switch.patch_switch(
         self.user_object,
         1,
         patched_credentials={
             'version': '2c',
             'community': 'public'
         }
     )
     patch_switch = switch.get_switch(
         self.user_object,
         1
     )
     expected = {
         'version': '2c',
         'community': 'public'
     }
     self.assertTrue(
         item in expected.items() for item in patch_switch.items()
     )
Example #4
0
 def test_patch_switch(self):
     switch.patch_switch(
         1,
         user=self.user_object,
         credentials={
             'version': '2c',
             'community': 'public'
         }
     )
     patch_switch = switch.get_switch(
         1,
         user=self.user_object,
     )
     expected = {
         'credentials': {
             'version': '2c',
             'community': 'public'
         }
     }
     self.assertTrue(
         all(item in patch_switch.items() for item in expected.items())
     )