Giter Club home page Giter Club logo

iridium's People

Contributors

apirogov avatar chriz-uniba avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

iridium's Issues

Tests inside CI

Figure out a way to set up Invenio RDM inside of the CI and use that instance for testing.

Improvement of vocabulary-tests needed?

The tests for vocabularies provided here:

def test_vocabularies(rdm):
"""Test queries to vocabularies."""
with pytest.raises(httpx.HTTPStatusError):
rdm.query.vocabulary("invalid_voc")
res = rdm.query.vocabulary(VocType.resource_types)
assert res.hits.total == 33
lcs = rdm.query.vocabulary(VocType.licenses)
assert lcs.hits.total == 418
sjs = rdm.query.vocabulary(VocType.subjects)
assert sjs.hits.total == 48
lgs = rdm.query.vocabulary(VocType.languages)
assert lgs.hits.total == 7847
assert rdm.query.vocabulary(VocType.languages, tags="extinct").hits.total == 619
lg = rdm.query.vocabulary(VocType.licenses, suggest="gli")
assert lg.hits.total == 1
assert lg.hits.hits[0].id == "glide"
with pytest.raises(httpx.HTTPStatusError):
rdm.query.term("license", "invalid_license")
gl = rdm.query.term(VocType.licenses, "glide")
assert gl.id == "glide"

are only working on instances where the vocabularies aren't adjusted. For example, a freshly installed instance.

It is expected and wanted behaviour that vocabularies are adapted and changed: https://inveniordm.docs.cern.ch/customize/vocabularies/
Our instance, for example, has already some other subjects and we are working on different record-types.

I wonder whether the current tests need more improvement or whether we want to limit these tests down to a 'untouched' vocabularies folder and we expect the user to disable or adjust these tests for their own instances.

pdoc --html flag not available.

Maybe my setup is outdated but for me this command doesn't run through:

Error

`pdoc --html -o docs iridium` (see [https://pdoc.dev](https://pdoc.dev)).

$ pdoc --html -o docs iridium
usage: pdoc [-o DIR] [-d {google,numpy,restructuredtext}] [-e module=url] [--footer-text TEXT] [--logo URL] [--logo-link URL] [--math | --no-math] [--search | --no-search] [--show-source | --no-show-source] [-t DIR] [-h HOST] [-p PORT] [-n] [--help] [--version] [module ...]
pdoc: error: unrecognized arguments: --html

Setup

$ pdoc --version
pdoc: 8.3.0
Python: 3.9.2
Platform: Linux-5.10.0-11-amd64-x86_64-with-glibc2.31

Working command

$ pdoc -o docs iridium

Creates

.
├── index.html
├── iridium
│   ├── api.html
│   ├── generic.html
│   ├── inveniordm
│   │   ├── models
│   │   │   ├── base.html
│   │   │   ├── biblio.html
│   │   │   ├── query.html
│   │   │   └── technical.html
│   │   └── models.html
│   ├── inveniordm.html
│   ├── pprint.html
│   ├── query.html
│   ├── record.html
│   └── util.html
├── iridium.html
└── search.js

3 directories, 15 files

Do we need to fix the Readme, or do I need to fix my setup? If it is my setup, let me know what is needed (and maybe add this to the Readme, too). ;)

Wrong documentation for delete method?

def get(self, record_id: str, link_id: str) -> AccessLink:
"""
Get information about access link for record.
https://inveniordm.docs.cern.ch/reference/rest_api_drafts_records/#get-an-access-link
"""
url = self._p._endpoint(f"/records/{record_id}/access/links/{link_id}")
r = self._p.client.get(url)
_raise_on_error_status(r)
return AccessLink.parse_obj(r.json())
def delete(self, record_id: str, link_id: str):
"""
Get information about access link for record.
https://inveniordm.docs.cern.ch/reference/rest_api_drafts_records/#get-an-access-link
"""
url = self._p._endpoint(f"/records/{record_id}/access/links/{link_id}")
r = self._p.client.delete(url)
_raise_on_error_status(r)

In line 236 I would expect some 'delete' information. Something like "Delete information about access link for record."?

Tests fail when running against invenioRDM-v8

$ poetry run pytest
================================================================================================================================================= test session starts =================================================================================================================================================
platform linux -- Python 3.9.2, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /home/chriz/rz/code/invenio/repos/iridium/iridium, configfile: pyproject.toml
plugins: anyio-3.5.0, cov-3.0.0, dotenv-0.5.2
collected 14 items                                                                                                                                                                                                                                                                                                    

tests/test_api.py EEE                                                                                                                                                                                                                                                                                           [ 21%]
tests/test_generic.py ...                                                                                                                                                                                                                                                                                       [ 42%]
tests/test_inveniordm_api.py EEEEEE                                                                                                                                                                                                                                                                             [ 85%]
tests/test_utils.py ..                                                                                                                                                                                                                                                                                          [100%]

======================================================================================================================================================= ERRORS ========================================================================================================================================================
_________________________________________________________________________________________________________________________________________ ERROR at setup of test_vocab_query __________________________________________________________________________________________________________________________________________

    @pytest.fixture(scope="session")
    def rdm():
        """Return an low-level API instance configured from environment variables."""
        cl = InvenioRDMClient.from_env(verify=False)
    
        # clean up all drafts from possible previous unclean runs
        if cl.connected():
>           drafts = cl.query.records(user=True, q="is_published:false")

tests/conftest.py:94: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
iridium/inveniordm/__init__.py:202: in records
    res.parse_hits(Record)
iridium/inveniordm/models/query.py:135: in parse_hits
    self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
iridium/inveniordm/models/query.py:135: in <listcomp>
    self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
iridium/inveniordm/models/base.py:66: in parse_obj
    return cast(cls, super().parse_obj(val, *args, **kwargs))
pydantic/main.py:578: in pydantic.main.BaseModel.parse_obj
    ???
iridium/inveniordm/models/base.py:29: in __init__
    super().__init__(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for Record
E   is_draft
E     extra fields not permitted (type=value_error.extra)

pydantic/main.py:406: ValidationError
____________________________________________________________________________________________________________________________________ ERROR at setup of test_readonly_fields_draft _____________________________________________________________________________________________________________________________________

    @pytest.fixture(scope="session")
    def rdm():
        """Return an low-level API instance configured from environment variables."""
        cl = InvenioRDMClient.from_env(verify=False)
    
        # clean up all drafts from possible previous unclean runs
        if cl.connected():
>           drafts = cl.query.records(user=True, q="is_published:false")

tests/conftest.py:94: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
iridium/inveniordm/__init__.py:202: in records
    res.parse_hits(Record)
iridium/inveniordm/models/query.py:135: in parse_hits
    self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
iridium/inveniordm/models/query.py:135: in <listcomp>
    self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
iridium/inveniordm/models/base.py:66: in parse_obj
    return cast(cls, super().parse_obj(val, *args, **kwargs))
pydantic/main.py:578: in pydantic.main.BaseModel.parse_obj
    ???
iridium/inveniordm/models/base.py:29: in __init__
    super().__init__(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for Record
E   is_draft
E     extra fields not permitted (type=value_error.extra)

pydantic/main.py:406: ValidationError
________________________________________________________________________________________________________________________________________ ERROR at setup of test_create_record _________________________________________________________________________________________________________________________________________

    @pytest.fixture(scope="session")
    def rdm():
        """Return an low-level API instance configured from environment variables."""
        cl = InvenioRDMClient.from_env(verify=False)
    
        # clean up all drafts from possible previous unclean runs
        if cl.connected():
>           drafts = cl.query.records(user=True, q="is_published:false")

tests/conftest.py:94: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
iridium/inveniordm/__init__.py:202: in records
    res.parse_hits(Record)
iridium/inveniordm/models/query.py:135: in parse_hits
    self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
iridium/inveniordm/models/query.py:135: in <listcomp>
    self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
iridium/inveniordm/models/base.py:66: in parse_obj
    return cast(cls, super().parse_obj(val, *args, **kwargs))
pydantic/main.py:578: in pydantic.main.BaseModel.parse_obj
    ???
iridium/inveniordm/models/base.py:29: in __init__
    super().__init__(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for Record
E   is_draft
E     extra fields not permitted (type=value_error.extra)

pydantic/main.py:406: ValidationError
_________________________________________________________________________________________________________________________________________ ERROR at setup of test_vocabularies _________________________________________________________________________________________________________________________________________

    @pytest.fixture(scope="session")
    def rdm():
        """Return an low-level API instance configured from environment variables."""
        cl = InvenioRDMClient.from_env(verify=False)
    
        # clean up all drafts from possible previous unclean runs
        if cl.connected():
>           drafts = cl.query.records(user=True, q="is_published:false")

tests/conftest.py:94: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
iridium/inveniordm/__init__.py:202: in records
    res.parse_hits(Record)
iridium/inveniordm/models/query.py:135: in parse_hits
    self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
iridium/inveniordm/models/query.py:135: in <listcomp>
    self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
iridium/inveniordm/models/base.py:66: in parse_obj
    return cast(cls, super().parse_obj(val, *args, **kwargs))
pydantic/main.py:578: in pydantic.main.BaseModel.parse_obj
    ???
iridium/inveniordm/models/base.py:29: in __init__
    super().__init__(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for Record
E   is_draft
E     extra fields not permitted (type=value_error.extra)

pydantic/main.py:406: ValidationError
________________________________________________________________________________________________________________________________________ ERROR at setup of test_record_queries ________________________________________________________________________________________________________________________________________

    @pytest.fixture(scope="session")
    def rdm():
        """Return an low-level API instance configured from environment variables."""
        cl = InvenioRDMClient.from_env(verify=False)
    
        # clean up all drafts from possible previous unclean runs
        if cl.connected():
>           drafts = cl.query.records(user=True, q="is_published:false")

tests/conftest.py:94: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
iridium/inveniordm/__init__.py:202: in records
    res.parse_hits(Record)
iridium/inveniordm/models/query.py:135: in parse_hits
    self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
iridium/inveniordm/models/query.py:135: in <listcomp>
    self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
iridium/inveniordm/models/base.py:66: in parse_obj
    return cast(cls, super().parse_obj(val, *args, **kwargs))
pydantic/main.py:578: in pydantic.main.BaseModel.parse_obj
    ???
iridium/inveniordm/models/base.py:29: in __init__
    super().__init__(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for Record
E   is_draft
E     extra fields not permitted (type=value_error.extra)

pydantic/main.py:406: ValidationError
__________________________________________________________________________________________________________________________________________ ERROR at setup of test_new_draft ___________________________________________________________________________________________________________________________________________

    @pytest.fixture(scope="session")
    def rdm():
        """Return an low-level API instance configured from environment variables."""
        cl = InvenioRDMClient.from_env(verify=False)
    
        # clean up all drafts from possible previous unclean runs
        if cl.connected():
>           drafts = cl.query.records(user=True, q="is_published:false")

tests/conftest.py:94: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
iridium/inveniordm/__init__.py:202: in records
    res.parse_hits(Record)
iridium/inveniordm/models/query.py:135: in parse_hits
    self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
iridium/inveniordm/models/query.py:135: in <listcomp>
    self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
iridium/inveniordm/models/base.py:66: in parse_obj
    return cast(cls, super().parse_obj(val, *args, **kwargs))
pydantic/main.py:578: in pydantic.main.BaseModel.parse_obj
    ???
iridium/inveniordm/models/base.py:29: in __init__
    super().__init__(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for Record
E   is_draft
E     extra fields not permitted (type=value_error.extra)

pydantic/main.py:406: ValidationError
______________________________________________________________________________________________________________________________________ ERROR at setup of test_draft_from_record _______________________________________________________________________________________________________________________________________

    @pytest.fixture(scope="session")
    def rdm():
        """Return an low-level API instance configured from environment variables."""
        cl = InvenioRDMClient.from_env(verify=False)
    
        # clean up all drafts from possible previous unclean runs
        if cl.connected():
>           drafts = cl.query.records(user=True, q="is_published:false")

tests/conftest.py:94: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
iridium/inveniordm/__init__.py:202: in records
    res.parse_hits(Record)
iridium/inveniordm/models/query.py:135: in parse_hits
    self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
iridium/inveniordm/models/query.py:135: in <listcomp>
    self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
iridium/inveniordm/models/base.py:66: in parse_obj
    return cast(cls, super().parse_obj(val, *args, **kwargs))
pydantic/main.py:578: in pydantic.main.BaseModel.parse_obj
    ???
iridium/inveniordm/models/base.py:29: in __init__
    super().__init__(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for Record
E   is_draft
E     extra fields not permitted (type=value_error.extra)

pydantic/main.py:406: ValidationError
_____________________________________________________________________________________________________________________________________ ERROR at setup of test_version_from_record ______________________________________________________________________________________________________________________________________

    @pytest.fixture(scope="session")
    def rdm():
        """Return an low-level API instance configured from environment variables."""
        cl = InvenioRDMClient.from_env(verify=False)
    
        # clean up all drafts from possible previous unclean runs
        if cl.connected():
>           drafts = cl.query.records(user=True, q="is_published:false")

tests/conftest.py:94: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
iridium/inveniordm/__init__.py:202: in records
    res.parse_hits(Record)
iridium/inveniordm/models/query.py:135: in parse_hits
    self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
iridium/inveniordm/models/query.py:135: in <listcomp>
    self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
iridium/inveniordm/models/base.py:66: in parse_obj
    return cast(cls, super().parse_obj(val, *args, **kwargs))
pydantic/main.py:578: in pydantic.main.BaseModel.parse_obj
    ???
iridium/inveniordm/models/base.py:29: in __init__
    super().__init__(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for Record
E   is_draft
E     extra fields not permitted (type=value_error.extra)

pydantic/main.py:406: ValidationError
_________________________________________________________________________________________________________________________________________ ERROR at setup of test_access_links _________________________________________________________________________________________________________________________________________

    @pytest.fixture(scope="session")
    def rdm():
        """Return an low-level API instance configured from environment variables."""
        cl = InvenioRDMClient.from_env(verify=False)
    
        # clean up all drafts from possible previous unclean runs
        if cl.connected():
>           drafts = cl.query.records(user=True, q="is_published:false")

tests/conftest.py:94: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
iridium/inveniordm/__init__.py:202: in records
    res.parse_hits(Record)
iridium/inveniordm/models/query.py:135: in parse_hits
    self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
iridium/inveniordm/models/query.py:135: in <listcomp>
    self.hits.hits = [obj_cls.parse_obj(x) for x in self.hits.hits]  # type: ignore
iridium/inveniordm/models/base.py:66: in parse_obj
    return cast(cls, super().parse_obj(val, *args, **kwargs))
pydantic/main.py:578: in pydantic.main.BaseModel.parse_obj
    ???
iridium/inveniordm/models/base.py:29: in __init__
    super().__init__(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for Record
E   is_draft
E     extra fields not permitted (type=value_error.extra)

pydantic/main.py:406: ValidationError
=============================================================================================================================================== short test summary info ===============================================================================================================================================
ERROR tests/test_api.py::test_vocab_query - pydantic.error_wrappers.ValidationError: 1 validation error for Record
ERROR tests/test_api.py::test_readonly_fields_draft - pydantic.error_wrappers.ValidationError: 1 validation error for Record
ERROR tests/test_api.py::test_create_record - pydantic.error_wrappers.ValidationError: 1 validation error for Record
ERROR tests/test_inveniordm_api.py::test_vocabularies - pydantic.error_wrappers.ValidationError: 1 validation error for Record
ERROR tests/test_inveniordm_api.py::test_record_queries - pydantic.error_wrappers.ValidationError: 1 validation error for Record
ERROR tests/test_inveniordm_api.py::test_new_draft - pydantic.error_wrappers.ValidationError: 1 validation error for Record
ERROR tests/test_inveniordm_api.py::test_draft_from_record - pydantic.error_wrappers.ValidationError: 1 validation error for Record
ERROR tests/test_inveniordm_api.py::test_version_from_record - pydantic.error_wrappers.ValidationError: 1 validation error for Record
ERROR tests/test_inveniordm_api.py::test_access_links - pydantic.error_wrappers.ValidationError: 1 validation error for Record
============================================================================================================================================= 5 passed, 9 errors in 1.90s =============================================================================================================================================

Looks like, there is an validation error. ;)

Maybe related: https://inveniordm.docs.cern.ch/releases/versions/version-v8.0.0/#my-dashboard

This also means we have changed the URL endpoint of the uploads page from `/uploads` to `/me/uploads` so that we can later add both `/me/communities` and `/me/requests`.

Edit: this seems to be an internal endpoint not an Rest-Api url-change.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.