File: test_update_versions.py

package info (click to toggle)
nodejs 20.19.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 219,072 kB
  • sloc: cpp: 1,277,408; javascript: 565,332; ansic: 129,476; python: 58,536; sh: 3,841; makefile: 2,725; asm: 1,732; perl: 248; lisp: 222; xml: 42
file content (53 lines) | stat: -rw-r--r-- 1,791 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
from .. import versions
import os


def test_update_cmakelists_version() -> None:
    current_dir = os.path.dirname(os.path.abspath(__file__))
    sample_path = f'{current_dir}/samples/cmakelists.txt'
    sample_expected_path = f'{current_dir}/samples/cmakelists_expected.txt'

    versions.update_cmakelists_version('2.0.0', sample_path)

    with open(sample_path, 'r') as cmake:
        given = cmake.read()

    with open(sample_expected_path, 'r') as cmake_expected:
        expected = cmake_expected.read()

    assert given == expected
    versions.update_cmakelists_version('1.0.0', sample_path)  # cleanup


def test_update_ada_version_h() -> None:
    current_dir = os.path.dirname(os.path.abspath(__file__))
    sample_path = f'{current_dir}/samples/ada_version_h.txt'
    sample_expected_path = f'{current_dir}/samples/ada_version_h_expected.txt'

    versions.update_ada_version_h('2.0.0', sample_path)

    with open(sample_path, 'r') as ada_version_h:
        given = ada_version_h.read()

    with open(sample_expected_path, 'r') as ada_version_h_expected:
        expected = ada_version_h_expected.read()

    assert given == expected
    versions.update_ada_version_h('1.0.0', sample_path)  # cleanup


def test_update_doxygen_version() -> None:
    current_dir = os.path.dirname(os.path.abspath(__file__))
    sample_path = f'{current_dir}/samples/doxygen.txt'
    sample_expected_path = f'{current_dir}/samples/doxygen_expected.txt'

    versions.update_doxygen_version('2.0.0', sample_path)

    with open(sample_path, 'r') as doxygen:
        given = doxygen.read()

    with open(sample_expected_path, 'r') as doxygen_expected:
        expected = doxygen_expected.read()

    assert given == expected
    versions.update_ada_version_h('1.0.0', sample_path)  # cleanup