summaryrefslogtreecommitdiff
path: root/tests/test_version_numbers.py
diff options
context:
space:
mode:
authorÁrni Dagur <arni@dagur.eu>2020-07-27 20:35:50 +0000
committerGitHub <noreply@github.com>2020-07-27 20:35:50 +0000
commit25684535e85a8bbb05b65b0da2304273d1d90ca0 (patch)
treeaad63588ac9eafe99ddd0d3ed847a3726d947271 /tests/test_version_numbers.py
parentdc35e6044c249261dfc46eff831d5885a993eb0f (diff)
Update upstream library to 0.3.0, respond to API changes (#10)
* Update upstream library to 0.3.0, respond to API changes * Change pypi publishing criteria in CI * Create test to make sure the version numbers are the same everywhere
Diffstat (limited to 'tests/test_version_numbers.py')
-rw-r--r--tests/test_version_numbers.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/test_version_numbers.py b/tests/test_version_numbers.py
new file mode 100644
index 0000000..6519ffa
--- /dev/null
+++ b/tests/test_version_numbers.py
@@ -0,0 +1,28 @@
1import toml
2import adblock
3
4
5def get_version_value_poetry():
6 with open("pyproject.toml", encoding="utf-8") as f:
7 pyproject_toml = toml.loads(f.read())
8 return pyproject_toml["tool"]["poetry"]["version"]
9
10
11def get_version_value_cargo():
12 with open("Cargo.toml", encoding="utf-8") as f:
13 cargo_toml = toml.loads(f.read())
14 return cargo_toml["package"]["version"]
15
16
17def test_version_numbers_all_same():
18 """
19 Makes sure that `pyproject.toml` and `Cargo.toml` contain the same version
20 number as the one attached to the `adblock` module.
21 """
22 cargo_version = get_version_value_cargo()
23 poetry_version = get_version_value_poetry()
24 module_version = adblock.__version__
25
26 assert cargo_version == poetry_version
27 assert poetry_version == module_version
28 assert cargo_version == module_version