File: test_individual_functions.py

package info (click to toggle)
python-azure 20250603%2Bgit-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 851,724 kB
  • sloc: python: 7,362,925; ansic: 804; javascript: 287; makefile: 195; sh: 145; xml: 109
file content (27 lines) | stat: -rw-r--r-- 872 bytes parent folder | download | duplicates (2)
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
# Used to test the individual functions in the `functions` module of azure-sdk-tools

import os
import pytest

from ci_tools.parsing import ParsedSetup, compare_string_to_glob_array
from typing import List


@pytest.mark.parametrize(
    "input_string, glob_array, expected_result",
    [
        ("sphinx", ["*"], True),
        ("sphinx", ["a*"], False),
        ("sphinx", [""], False),
        ("sphinx", ["sphinx2"], False),
        ("sphinx", ["whl"], False),
        ("sphinx", ["sphinx"], True),
        ("sphinx", ["sphinx "], False),
        ("azure-storage-blob", ["azure-*"], True),
        ("azure-storage-blob", ["azure-storage*"], True),
    ],
)
def test_compare_string_to_glob_array(input_string: str, glob_array: List[str], expected_result: bool):
    result = compare_string_to_glob_array(input_string, glob_array)

    assert result == expected_result