File: test_config.py

package info (click to toggle)
pyroute2 0.8.1-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,704 kB
  • sloc: python: 50,245; makefile: 280; javascript: 183; ansic: 81; sh: 44; awk: 17
file content (16 lines) | stat: -rw-r--r-- 422 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from pyroute2 import config


def test_kernel_version():
    versions = {
        '1.2.3-test01': [1, 2, 3],
        '1.2.3.test01': [1, 2, 3],
        '10.1.12': [10, 1, 12],
        'test.10.12': [],
        '2.10.test01': [2, 10],
        '5.16.5-200.fc35.x86_64': [5, 16, 5],
        '5.15.15.debug': [5, 15, 15],
    }

    for key, value in versions.items():
        assert config.parse_kernel_version(key) == value