def test_barrier_details(self, mock_get):
        barrier_id = 3
        mock_get.return_value = dummy_barrier_details(barrier_id)
        expected_public_id = f"PID-{barrier_id}"
        barrier = data_gateway.barrier_details(id=barrier_id)

        assert expected_public_id == barrier.public_id
    def test_barrier_details_404(self, mock_get):
        barrier_id = "something-non-existent"
        mock_get.return_value = dummy_barrier_details(barrier_id)

        with self.assertRaisesMessage(Http404, "Barrier does not exist"):
            data_gateway.barrier_details(id=barrier_id)
예제 #3
0
 def get(self, request, *args, **kwargs):
     self.barrier = data_gateway.barrier_details(
         id=self.kwargs["barrier_id"],
         headers=self.request.zipkin_http_headers,
     )
     return super().get(request, *args, **kwargs)