Skip to content

Commit fd3eb6c

Browse files
committed
Restore test_version.py
1 parent 77d8c90 commit fd3eb6c

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

tests/test_version.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#
2+
# Gramps Web API - A RESTful API for the Gramps genealogy program
3+
#
4+
# Copyright (C) 2021 David Straub
5+
#
6+
# This program is free software; you can redistribute it and/or modify
7+
# it under the terms of the GNU Affero 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+
# This program 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 Affero General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU Affero General Public License
17+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
18+
#
19+
20+
"""Test consistent version numbers."""
21+
22+
import unittest
23+
24+
import yaml
25+
from pkg_resources import resource_filename
26+
27+
from gramps_webapi import __version__
28+
29+
30+
class TestVersion(unittest.TestCase):
31+
"""Test the version specifiers are consistent."""
32+
33+
def test_version(self):
34+
"""Test version in setup and apispec are equal."""
35+
with open(
36+
resource_filename("gramps_webapi", "data/apispec.yaml")
37+
) as file_handle:
38+
schema = yaml.safe_load(file_handle)
39+
self.assertEqual(__version__, schema["info"]["version"])

0 commit comments

Comments
 (0)