blob: 0703d34ba27b93fb7c797d5a72add2a950a3d79d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
"""Tests requirements module."""
from ansible_compat.runtime import Runtime
from ansiblelint.requirements import Reqs
def test_reqs() -> None:
"""Performs basic testing of Reqs class."""
reqs = Reqs()
runtime = Runtime()
assert "ansible-core" in reqs
# checks that this ansible core version is not supported:
assert reqs.matches("ansible-core", "0.0") is False
# assert that invalid package name
assert reqs.matches("this-package-does-not-exist", "0.0") is False
# check the current ansible core version is supported:
assert reqs.matches("ansible-core", runtime.version)
|