Did I find the right examples for you? yes no

All Samples(10)  |  Call(10)  |  Derive(0)  |  Import(0)

src/t/u/tuskar-HEAD/tuskar/tests/api/controllers/v1/test_racks.py   tuskar(Download)
    def test_it_updates_rack(self):
        json = {
            'name': 'blabla',
        }
        response = self.put_json('/racks/' + str(self.test_rack.id),
    def test_it_allow_to_update_rack_state(self):
        json = {
            'state': 'active',
        }
        response = self.put_json('/racks/' + str(self.test_rack.id),
    def test_it_not_allow_to_update_rack_state_with_unknown_state(self):
        json = {
            'state': 'trololo',
        }
        response = self.put_json('/racks/' + str(self.test_rack.id),
        }
        first_update_response = self.put_json(
            '/racks/' + str(self.test_rack.id),
            rack_update_json)
        self.assertEqual(first_update_response.status_int, 200)
        # already present
        second_update_response = self.put_json(
            '/racks/' + str(self.test_rack.id),
            rack_update_json)
        self.assertEqual(second_update_response.status_int, 200)

src/t/u/tuskar-HEAD/tuskar/tests/api/controllers/v1/test_flavors.py   tuskar(Download)
                {'name': 'storage', 'value': '2222', 'unit': 'GB'},
            ]}
        update_response=self.put_json('/resource_classes/'+str(self.rc.id)+
                                  '/flavors/'+str(flav_id), params=update_json,
                                  status=200)
                           {'name': 'cpu', 'value': '2', 'unit': 'count'},
                           {'name': 'storage', 'value': '2', 'unit': 'GB'}]}]}
        update_response=self.put_json('/resource_classes/'+str(self.rc.id),
                                         params=replace_json, status=200)
        self.assertEqual(response.content_type, "application/json")

src/t/u/tuskar-HEAD/tuskar/tests/api/controllers/v1/test_resource_class.py   tuskar(Download)
    def test_update_name_only(self):
        json = {'name': 'updated name'}
        response = self.put_json('/resource_classes/' + str(self.rc.id),
                                 params=json, status=200)
        self.assertEqual(response.content_type, 'application/json')
        json = {'racks': [{'id': self.racks[0].id},
                          {'id': self.racks[1].id}]}
        response = self.put_json('/resource_classes/' + str(self.rc.id),
                                 params=json, status=200)
        self.assert_racks_present(json, response)
 
        # Re-assign racks: remove one, keep one, add one new
        json = {'racks': [{'id': self.racks[1].id},
                          {'id': self.racks[2].id}]}
        response = self.put_json('/resource_classes/' + str(self.rc.id),