Exemplo n.º 1
0
 def test_region_detail_delete_ok(self):
     region_id = '2'
     request = self.api_factory.delete('/swift/regions/' + region_id)
     response = region_detail(request, region_id)
     self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT)
     request = self.api_factory.get('/swift/regions/' + region_id)
     response = region_detail(request, region_id)
     self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
Exemplo n.º 2
0
 def test_region_detail_get_not_found(self):
     region_id = '3'
     request = self.api_factory.get('/swift/regions/' + region_id)
     response = region_detail(request, region_id)
     self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
Exemplo n.º 3
0
 def test_region_detail_get_ok(self):
     region_id = '2'
     request = self.api_factory.get('/swift/regions/' + region_id)
     response = region_detail(request, region_id)
     self.assertEqual(response.status_code, status.HTTP_200_OK)
Exemplo n.º 4
0
 def test_region_detail_update_ok(self):
     region_id = '2'
     request = self.api_factory.put('/swift/regions/' + region_id, {'name': 'data_center'}, format='json')
     response = region_detail(request, region_id)
     self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT)
Exemplo n.º 5
0
 def test_region_detail_delete_with_zone_assigned(self):
     region_id = '1'
     request = self.api_factory.delete('/swift/regions/' + region_id)
     response = region_detail(request, region_id)
     self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)