0

I'm trying to create a mock test, but I'm getting the error: No mock address: GET In my view the test is correct, can someone help me find the problem?

Test code:

    def test_get_entity(self, requests_mock: MockerCore):
        contents = [
            {
                "name": "1",
                "count": 516
            },
            {
                "name": "1",
                "count": 507
            },
            {
                "name": "1",
                "count": 496
            }
        ]
        requests_mock.get(
            f'{self.service.base_url}/{self.name}',
            status_code=200,
            json={
                "tags": contents,
            }
        )

        result = self.service.get_entity(self.name, 1)

        assert result == contents
Leticia Fatima
  • 512
  • 2
  • 4
  • 19

0 Answers0