def test_search_with_no_device(self):
        """use default as defined in config unless overridden"""
        temp_client = copy.deepcopy(self.client)

        mock__post = mock.MagicMock()
        @mock.patch("marqo._httprequests.HttpRequests.post", mock__post)
        def run():
            temp_client.index(self.text_index_name).search(q="my search term")
            temp_client.index(self.text_index_name).search(q="my search term", device="cuda:2")
            return True
        assert run()
        # no device in path when device is not set
        args, kwargs0 = mock__post.call_args_list[0]
        assert "device" not in kwargs0["path"]
        # device in path if it is set
        args, kwargs1 = mock__post.call_args_list[1]
        assert "device=cuda2" in kwargs1["path"]
use default as defined in config unless overridden
tests/api_tests/v1/tests/api_tests/unstructured_index/test_search.py