Skip to content

Commit 72d25b6

Browse files
committed
tests: rename more comments for consistency
- Removed references to Invenio-GitHub and replaced with "VCS" where applicable
1 parent b3d46f3 commit 72d25b6

File tree

12 files changed

+38
-136
lines changed

12 files changed

+38
-136
lines changed

tests/conftest.py

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,9 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# This file is part of Invenio.
43
# Copyright (C) 2023-2025 CERN.
5-
# Copyright (C) 2025 Graz University of Technology.
64
#
7-
# Invenio is free software; you can redistribute it
8-
# and/or modify it under the terms of the GNU General Public License as
9-
# published by the Free Software Foundation; either version 2 of the
10-
# License, or (at your option) any later version.
11-
#
12-
# Invenio is distributed in the hope that it will be
13-
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15-
# General Public License for more details.
16-
#
17-
# You should have received a copy of the GNU General Public License
18-
# along with Invenio; if not, write to the
19-
# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20-
# MA 02111-1307, USA.
21-
#
22-
# In applying this license, CERN does not
23-
# waive the privileges and immunities granted to it by virtue of its status
24-
# as an Intergovernmental Organization or submit itself to any jurisdiction.
25-
5+
# Invenio-VCS is free software; you can redistribute it and/or modify
6+
# it under the terms of the MIT License; see LICENSE file for more details.
267
"""Pytest configuration."""
278

289
from __future__ import absolute_import, print_function
@@ -154,7 +135,7 @@ def running_app(app, location, cache):
154135
def test_user(app, db, remote_apps):
155136
"""Creates a test user.
156137
157-
Links the user to a github RemoteToken.
138+
Links the user to a VCS RemoteToken.
158139
"""
159140
datastore = app.extensions["security"].datastore
160141
user = datastore.create_user(

tests/contrib_fixtures/gitlab.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
#
33
# Copyright (C) 2025 CERN.
44
#
5-
# Invenio-Github is free software; you can redistribute it and/or modify
5+
# Invenio-VCS is free software; you can redistribute it and/or modify
66
# it under the terms of the MIT License; see LICENSE file for more details.
7+
#
8+
# Some of the code in this file was taken from https://codebase.helmholtz.cloud/rodare/invenio-gitlab
9+
# and relicensed under MIT with permission from the authors.
710
"""Fixture test impl for GitLab."""
811

912
from typing import Any, Iterator

tests/fixtures.py

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,17 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# This file is part of Invenio.
4-
# Copyright (C) 2023 CERN.
3+
# Copyright (C) 2023-2025 CERN.
54
#
6-
# Invenio is free software: you can redistribute it and/or modify
7-
# it under the terms of the GNU General Public License as published by
8-
# the Free Software Foundation, either version 3 of the License, or
9-
# (at your option) any later version.
10-
#
11-
# Invenio is distributed in the hope that it will be useful,
12-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14-
# GNU General Public License for more details.
15-
#
16-
# You should have received a copy of the GNU General Public License
17-
# along with Invenio. If not, see <http://www.gnu.org/licenses/>.
18-
#
19-
# In applying this licence, CERN does not waive the privileges and immunities
20-
# granted to it by virtue of its status as an Intergovernmental Organization
21-
# or submit itself to any jurisdiction.
22-
5+
# Invenio-VCS is free software; you can redistribute it and/or modify
6+
# it under the terms of the MIT License; see LICENSE file for more details.
237
"""Define fixtures for tests."""
8+
249
from invenio_vcs.models import ReleaseStatus
2510
from invenio_vcs.service import VCSRelease
2611

2712

2813
class TestVCSRelease(VCSRelease):
29-
"""Implements GithubRelease with test methods."""
14+
"""Implements VCSRelease with test methods."""
3015

3116
def publish(self):
3217
"""Sets release status to published.

tests/test_alembic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# Copyright (C) 2023 CERN.
44
# Copyright (C) 2024 Graz University of Technology.
55
#
6-
# Invenio-Github is free software; you can redistribute it and/or modify
6+
# Invenio-vcs is free software; you can redistribute it and/or modify
77
# it under the terms of the MIT License; see LICENSE file for more details.
8-
"""Test invenio-github alembic."""
8+
"""Test invenio-vcs alembic."""
99

1010
import pytest
1111
from invenio_db.utils import alembic_test_context, drop_alembic_version_table

tests/test_badge.py

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,9 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# This file is part of Invenio.
4-
# Copyright (C) 2015, 2016 CERN.
3+
# Copyright (C) 2023-2025 CERN.
54
#
6-
# Invenio is free software: you can redistribute it and/or modify
7-
# it under the terms of the GNU General Public License as published by
8-
# the Free Software Foundation, either version 3 of the License, or
9-
# (at your option) any later version.
10-
#
11-
# Invenio is distributed in the hope that it will be useful,
12-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14-
# GNU General Public License for more details.
15-
#
16-
# You should have received a copy of the GNU General Public License
17-
# along with Invenio. If not, see <http://www.gnu.org/licenses/>.
18-
#
19-
# In applying this licence, CERN does not waive the privileges and immunities
20-
# granted to it by virtue of its status as an Intergovernmental Organization
21-
# or submit itself to any jurisdiction.
22-
5+
# Invenio-VCS is free software; you can redistribute it and/or modify
6+
# it under the terms of the MIT License; see LICENSE file for more details.
237
"""Test cases for badge creation."""
248

259
from __future__ import absolute_import

tests/test_invenio_vcs.py

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,9 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# This file is part of Invenio.
4-
# Copyright (C) 2023 CERN.
3+
# Copyright (C) 2023-2025 CERN.
54
#
6-
# Invenio is free software; you can redistribute it
7-
# and/or modify it under the terms of the GNU General Public License as
8-
# published by the Free Software Foundation; either version 2 of the
9-
# License, or (at your option) any later version.
10-
#
11-
# Invenio is distributed in the hope that it will be
12-
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14-
# General Public License for more details.
15-
#
16-
# You should have received a copy of the GNU General Public License
17-
# along with Invenio; if not, write to the
18-
# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
19-
# MA 02111-1307, USA.
20-
#
21-
# In applying this license, CERN does not
22-
# waive the privileges and immunities granted to it by virtue of its status
23-
# as an Intergovernmental Organization or submit itself to any jurisdiction.
24-
25-
5+
# Invenio-VCS is free software; you can redistribute it and/or modify
6+
# it under the terms of the MIT License; see LICENSE file for more details.
267
"""Module tests."""
278

289
from flask import Flask

tests/test_models.py

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,9 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# This file is part of Invenio.
4-
# Copyright (C) 2023 CERN.
3+
# Copyright (C) 2023-2025 CERN.
54
#
6-
# Invenio is free software: you can redistribute it and/or modify
7-
# it under the terms of the GNU General Public License as published by
8-
# the Free Software Foundation, either version 3 of the License, or
9-
# (at your option) any later version.
10-
#
11-
# Invenio is distributed in the hope that it will be useful,
12-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14-
# GNU General Public License for more details.
15-
#
16-
# You should have received a copy of the GNU General Public License
17-
# along with Invenio. If not, see <http://www.gnu.org/licenses/>.
18-
#
19-
# In applying this licence, CERN does not waive the privileges and immunities
20-
# granted to it by virtue of its status as an Intergovernmental Organization
21-
# or submit itself to any jurisdiction.
22-
5+
# Invenio-VCS is free software; you can redistribute it and/or modify
6+
# it under the terms of the MIT License; see LICENSE file for more details.
237
"""Test cases for VCS models."""
248

259
from invenio_vcs.models import Repository

tests/test_provider.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
#
33
# Copyright (C) 2025 CERN.
44
#
5-
# Invenio-Github is free software; you can redistribute it and/or modify
5+
# Invenio-VCS is free software; you can redistribute it and/or modify
66
# it under the terms of the MIT License; see LICENSE file for more details.
7-
"""Test invenio-vcs providers."""
7+
"""Test invenio-vcs provider layer."""
88

99
from invenio_vcs.generic_models import (
1010
GenericContributor,

tests/test_service.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
#
33
# Copyright (C) 2023-2025 CERN.
44
#
5-
# Invenio-Github is free software; you can redistribute it and/or modify
5+
# Invenio-VCS is free software; you can redistribute it and/or modify
66
# it under the terms of the MIT License; see LICENSE file for more details.
7-
"""Test invenio-github api."""
7+
"""Test invenio-vcs service layer."""
88

99
import json
1010

@@ -79,9 +79,6 @@ def test_vcs_service_get_repository(
7979
assert repository.provider_id == test_generic_repositories[0].id
8080

8181

82-
# GithubRelease api tests
83-
84-
8582
def test_release_api(
8683
app,
8784
test_user,
@@ -110,7 +107,7 @@ def test_release_api(
110107
status=ReleaseStatus.RECEIVED,
111108
)
112109

113-
# Idea is to test the public interface of GithubRelease
110+
# Idea is to test the public interface of VCSRelease
114111
r = VCSRelease(release, vcs_service.provider)
115112

116113
# Validate that public methods raise NotImplementedError

tests/test_tasks.py

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,10 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# This file is part of Invenio.
4-
# Copyright (C) 2023 CERN.
3+
# Copyright (C) 2025 CERN.
54
#
6-
# Invenio is free software: you can redistribute it and/or modify
7-
# it under the terms of the GNU General Public License as published by
8-
# the Free Software Foundation, either version 3 of the License, or
9-
# (at your option) any later version.
10-
#
11-
# Invenio is distributed in the hope that it will be useful,
12-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14-
# GNU General Public License for more details.
15-
#
16-
# You should have received a copy of the GNU General Public License
17-
# along with Invenio. If not, see <http://www.gnu.org/licenses/>.
18-
#
19-
# In applying this licence, CERN does not waive the privileges and immunities
20-
# granted to it by virtue of its status as an Intergovernmental Organization
21-
# or submit itself to any jurisdiction.
5+
# Invenio-VCS is free software; you can redistribute it and/or modify
6+
# it under the terms of the MIT License; see LICENSE file for more details.
7+
"""Test celery task handlers."""
228

239
from time import sleep
2410
from unittest.mock import patch
@@ -78,7 +64,7 @@ def test_real_process_release_task(
7864
assert db_repo.releases.count() == 1
7965
release = db_repo.releases.first()
8066
assert release.status == ReleaseStatus.PUBLISHED
81-
# This uuid is a fake one set by TestGithubRelease fixture
67+
# This uuid is a fake one set by TestVCSRelease fixture
8268
assert str(release.record_id) == "445aaacd-9de1-41ab-af52-25ab6cb93df7"
8369

8470

0 commit comments

Comments
 (0)