Skip to content

Use project template #136

Use project template

Use project template #136

GitHub Actions / JUnit Test Report failed Sep 25, 2024 in 0s

32 tests run, 25 passed, 1 skipped, 6 failed.

Annotations

Check failure on line 1 in .venv/lib/python3.11/site-packages/mypy/xml/mypy.xsd

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

mypy.mypy-py3_11-linux

mypy produced messages
Raw output
tests/utils.py:25: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]

Check failure on line 11 in tests/parameter_types/test_graph.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_graph.test_graph_parameter_type_completion

requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://plugin-testing.eccenca.dev/auth/realms/cmem/protocol/openid-connect/token
Raw output
@needs_cmem
    def test_graph_parameter_type_completion() -> None:
        """Test graph parameter type completion"""
        parameter = GraphParameterType(show_system_graphs=True)
>       context = TestPluginContext()

tests/parameter_types/test_graph.py:11: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/utils.py:41: in __init__
    self.user = TestUserContext()
tests/utils.py:25: in __init__
    access_token: str = get_token()["access_token"]
.venv/lib/python3.11/site-packages/cmem/cmempy/api.py:38: in get_token
    post_req.raise_for_status()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Response [400]>

    def raise_for_status(self):
        """Raises :class:`HTTPError`, if one occurred."""
    
        http_error_msg = ""
        if isinstance(self.reason, bytes):
            # We attempt to decode utf-8 first because some servers
            # choose to localize their reason strings. If the string
            # isn't utf-8, we fall back to iso-8859-1 for all other
            # encodings. (See PR #3538)
            try:
                reason = self.reason.decode("utf-8")
            except UnicodeDecodeError:
                reason = self.reason.decode("iso-8859-1")
        else:
            reason = self.reason
    
        if 400 <= self.status_code < 500:
            http_error_msg = (
                f"{self.status_code} Client Error: {reason} for url: {self.url}"
            )
    
        elif 500 <= self.status_code < 600:
            http_error_msg = (
                f"{self.status_code} Server Error: {reason} for url: {self.url}"
            )
    
        if http_error_msg:
>           raise HTTPError(http_error_msg, response=self)
E           requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://plugin-testing.eccenca.dev/auth/realms/cmem/protocol/openid-connect/token

.venv/lib/python3.11/site-packages/requests/models.py:1024: HTTPError

Check failure on line 14 in .venv/lib/python3.11/site-packages/setuptools/_vendor/importlib_resources/tests/test_resource.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_resource.test_resource_parameter_type_completion

requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://plugin-testing.eccenca.dev/auth/realms/cmem/protocol/openid-connect/token
Raw output
json_resource = JSONResourceFixtureDate(project_name='resource_test_project', resource_name='sample_test.json')

    @needs_cmem
    def test_resource_parameter_type_completion(json_resource: JSONResourceFixtureDate) -> None:
        """Test resource parameter type completion"""
        project_name = json_resource.project_name
        resource_name = json_resource.resource_name
        parameter = ResourceParameterType()
>       context = TestPluginContext(project_name)

tests/parameter_types/test_resource.py:14: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/utils.py:41: in __init__
    self.user = TestUserContext()
tests/utils.py:25: in __init__
    access_token: str = get_token()["access_token"]
.venv/lib/python3.11/site-packages/cmem/cmempy/api.py:38: in get_token
    post_req.raise_for_status()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Response [400]>

    def raise_for_status(self):
        """Raises :class:`HTTPError`, if one occurred."""
    
        http_error_msg = ""
        if isinstance(self.reason, bytes):
            # We attempt to decode utf-8 first because some servers
            # choose to localize their reason strings. If the string
            # isn't utf-8, we fall back to iso-8859-1 for all other
            # encodings. (See PR #3538)
            try:
                reason = self.reason.decode("utf-8")
            except UnicodeDecodeError:
                reason = self.reason.decode("iso-8859-1")
        else:
            reason = self.reason
    
        if 400 <= self.status_code < 500:
            http_error_msg = (
                f"{self.status_code} Client Error: {reason} for url: {self.url}"
            )
    
        elif 500 <= self.status_code < 600:
            http_error_msg = (
                f"{self.status_code} Server Error: {reason} for url: {self.url}"
            )
    
        if http_error_msg:
>           raise HTTPError(http_error_msg, response=self)
E           requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://plugin-testing.eccenca.dev/auth/realms/cmem/protocol/openid-connect/token

.venv/lib/python3.11/site-packages/requests/models.py:1024: HTTPError

Check failure on line 23 in tests/test_utils_write_to_dataset.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_utils_write_to_dataset.test_write_to_json_dataset

requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://plugin-testing.eccenca.dev/auth/realms/cmem/protocol/openid-connect/token
Raw output
json_dataset = {'data': {'parameters': {'basePath': '', 'file': 'sample_test.json', 'maxDepth': '15', 'streaming': 'true', ...}, 'rea...e-account-cmem-service-account', 'modified': '2024-09-25T13:47:46.320495546Z'}, 'project': 'dateset_test_project', ...}

    @needs_cmem
    def test_write_to_json_dataset(json_dataset: dict) -> None:
        """Test write to json dataset"""
        project_name = json_dataset["project"]
        dataset_name = json_dataset["id"]
    
        parameter = DatasetParameterType(dataset_type="json")
        dataset_id = f"{project_name}:{dataset_name}"
>       context = TestPluginContext(project_name)

tests/test_utils_write_to_dataset.py:23: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/utils.py:41: in __init__
    self.user = TestUserContext()
tests/utils.py:25: in __init__
    access_token: str = get_token()["access_token"]
.venv/lib/python3.11/site-packages/cmem/cmempy/api.py:38: in get_token
    post_req.raise_for_status()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Response [400]>

    def raise_for_status(self):
        """Raises :class:`HTTPError`, if one occurred."""
    
        http_error_msg = ""
        if isinstance(self.reason, bytes):
            # We attempt to decode utf-8 first because some servers
            # choose to localize their reason strings. If the string
            # isn't utf-8, we fall back to iso-8859-1 for all other
            # encodings. (See PR #3538)
            try:
                reason = self.reason.decode("utf-8")
            except UnicodeDecodeError:
                reason = self.reason.decode("iso-8859-1")
        else:
            reason = self.reason
    
        if 400 <= self.status_code < 500:
            http_error_msg = (
                f"{self.status_code} Client Error: {reason} for url: {self.url}"
            )
    
        elif 500 <= self.status_code < 600:
            http_error_msg = (
                f"{self.status_code} Server Error: {reason} for url: {self.url}"
            )
    
        if http_error_msg:
>           raise HTTPError(http_error_msg, response=self)
E           requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://plugin-testing.eccenca.dev/auth/realms/cmem/protocol/openid-connect/token

.venv/lib/python3.11/site-packages/requests/models.py:1024: HTTPError

Check failure on line 36 in tests/test_utils_write_to_dataset.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_utils_write_to_dataset.test_write_to_not_valid_dataset

AssertionError: Regex pattern did not match.
 Regex: '404 Client Error: Not Found for url.*datasets/INVALID_DATASET/file.*'
 Input: '400 Client Error: Bad Request for url: https://plugin-testing.eccenca.dev/auth/realms/cmem/protocol/openid-connect/token'
Raw output
@needs_cmem
    def test_write_to_not_valid_dataset() -> None:
        """Test write to not valid dataset"""
        with pytest.raises(
            requests.exceptions.HTTPError,
            match=r"404 Client Error: Not Found for url.*datasets/INVALID_DATASET/file.*",
        ):
            write_to_dataset(
                "INVALID_PROJECT:INVALID_DATASET",
                io.StringIO("{}"),
>               TestPluginContext().user,
            )

tests/test_utils_write_to_dataset.py:43: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/utils.py:41: in __init__
    self.user = TestUserContext()
tests/utils.py:25: in __init__
    access_token: str = get_token()["access_token"]
.venv/lib/python3.11/site-packages/cmem/cmempy/api.py:38: in get_token
    post_req.raise_for_status()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Response [400]>

    def raise_for_status(self):
        """Raises :class:`HTTPError`, if one occurred."""
    
        http_error_msg = ""
        if isinstance(self.reason, bytes):
            # We attempt to decode utf-8 first because some servers
            # choose to localize their reason strings. If the string
            # isn't utf-8, we fall back to iso-8859-1 for all other
            # encodings. (See PR #3538)
            try:
                reason = self.reason.decode("utf-8")
            except UnicodeDecodeError:
                reason = self.reason.decode("iso-8859-1")
        else:
            reason = self.reason
    
        if 400 <= self.status_code < 500:
            http_error_msg = (
                f"{self.status_code} Client Error: {reason} for url: {self.url}"
            )
    
        elif 500 <= self.status_code < 600:
            http_error_msg = (
                f"{self.status_code} Server Error: {reason} for url: {self.url}"
            )
    
        if http_error_msg:
>           raise HTTPError(http_error_msg, response=self)
E           requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://plugin-testing.eccenca.dev/auth/realms/cmem/protocol/openid-connect/token

.venv/lib/python3.11/site-packages/requests/models.py:1024: HTTPError

During handling of the above exception, another exception occurred:

    @needs_cmem
    def test_write_to_not_valid_dataset() -> None:
        """Test write to not valid dataset"""
>       with pytest.raises(
            requests.exceptions.HTTPError,
            match=r"404 Client Error: Not Found for url.*datasets/INVALID_DATASET/file.*",
        ):
E       AssertionError: Regex pattern did not match.
E        Regex: '404 Client Error: Not Found for url.*datasets/INVALID_DATASET/file.*'
E        Input: '400 Client Error: Bad Request for url: https://plugin-testing.eccenca.dev/auth/realms/cmem/protocol/openid-connect/token'

tests/test_utils_write_to_dataset.py:36: AssertionError

Check failure on line 51 in tests/test_utils_write_to_dataset.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_utils_write_to_dataset.test_write_to_invalid_format_dataset_id

requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://plugin-testing.eccenca.dev/auth/realms/cmem/protocol/openid-connect/token
Raw output
@needs_cmem
    def test_write_to_invalid_format_dataset_id() -> None:
        """Test write to invalid format dataset id"""
        with pytest.raises(ValueError, match=r"INVALID_DATASET_ID_FORMAT is not a valid task ID."):
>           write_to_dataset("INVALID_DATASET_ID_FORMAT", io.StringIO("{}"), TestPluginContext().user)

tests/test_utils_write_to_dataset.py:51: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/utils.py:41: in __init__
    self.user = TestUserContext()
tests/utils.py:25: in __init__
    access_token: str = get_token()["access_token"]
.venv/lib/python3.11/site-packages/cmem/cmempy/api.py:38: in get_token
    post_req.raise_for_status()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Response [400]>

    def raise_for_status(self):
        """Raises :class:`HTTPError`, if one occurred."""
    
        http_error_msg = ""
        if isinstance(self.reason, bytes):
            # We attempt to decode utf-8 first because some servers
            # choose to localize their reason strings. If the string
            # isn't utf-8, we fall back to iso-8859-1 for all other
            # encodings. (See PR #3538)
            try:
                reason = self.reason.decode("utf-8")
            except UnicodeDecodeError:
                reason = self.reason.decode("iso-8859-1")
        else:
            reason = self.reason
    
        if 400 <= self.status_code < 500:
            http_error_msg = (
                f"{self.status_code} Client Error: {reason} for url: {self.url}"
            )
    
        elif 500 <= self.status_code < 600:
            http_error_msg = (
                f"{self.status_code} Server Error: {reason} for url: {self.url}"
            )
    
        if http_error_msg:
>           raise HTTPError(http_error_msg, response=self)
E           requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://plugin-testing.eccenca.dev/auth/realms/cmem/protocol/openid-connect/token

.venv/lib/python3.11/site-packages/requests/models.py:1024: HTTPError