File: test_ci_metadata.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 (23 lines) | stat: -rw-r--r-- 867 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import os, tempfile, shutil

import pytest

from ci_tools.parsing import get_ci_config
from ci_tools.environment_exclusions import is_check_enabled

integration_folder = os.path.join(os.path.dirname(__file__), "integration")
scenario_present = os.path.join(integration_folder, "scenarios", "ci_yml_present", "service", "fake-package")
scenario_not_present = os.path.join(integration_folder, "scenarios", "ci_yml_not_present", "service", "fake-package")

def test_ci_config_present():
    config = get_ci_config(scenario_present)
    assert config is not None
    assert type(config) is dict
    assert type(config["extends"]) is dict

    should_proxy = config.get("extends", {}).get("parameters", {}).get("TestProxy", True)
    assert should_proxy == False

def test_ci_config_non_present():
    config = get_ci_config(scenario_not_present)
    assert config is None