id int64 0 458k | file_name stringlengths 4 119 | file_path stringlengths 14 227 | content stringlengths 24 9.96M | size int64 24 9.96M | language stringclasses 1
value | extension stringclasses 14
values | total_lines int64 1 219k | avg_line_length float64 2.52 4.63M | max_line_length int64 5 9.91M | alphanum_fraction float64 0 1 | repo_name stringlengths 7 101 | repo_stars int64 100 139k | repo_forks int64 0 26.4k | repo_open_issues int64 0 2.27k | repo_license stringclasses 12
values | repo_extraction_date stringclasses 433
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
13,900 | test_RedirectHandlerFactory.py | ansible_ansible/test/units/module_utils/urls/test_RedirectHandlerFactory.py | # -*- coding: utf-8 -*-
# (c) 2018 Matt Martz <matt@sivel.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import io
import urllib.request
import urllib.error
from ansible.module_utils.urls import HTTPRedirectHandler
import pytest
... | 5,003 | Python | .py | 90 | 49.911111 | 152 | 0.701232 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,901 | test_prepare_multipart.py | ansible_ansible/test/units/module_utils/urls/test_prepare_multipart.py | # -*- coding: utf-8 -*-
# (c) 2020 Matt Martz <matt@sivel.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import os
from email.message import Message
import pytest
from ansible.module_utils.urls import prepare_multipart
def test... | 3,063 | Python | .py | 79 | 31.329114 | 92 | 0.59433 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,902 | test_gzip.py | ansible_ansible/test/units/module_utils/urls/test_gzip.py | # -*- coding: utf-8 -*-
# (c) 2021 Matt Martz <matt@sivel.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import gzip
import io
import sys
import http.client
from ansible.module_utils.urls import GzipDecodedReader, Request
import p... | 2,688 | Python | .py | 80 | 29.0625 | 123 | 0.679751 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,903 | test_channel_binding.py | ansible_ansible/test/units/module_utils/urls/test_channel_binding.py | # -*- coding: utf-8 -*-
# (c) 2020 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import base64
import os.path
import pytest
from ansible.module_utils.compat.version import LooseVersion
from ansible.module_utils import u... | 4,289 | Python | .py | 82 | 39.268293 | 94 | 0.559476 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,904 | test_urls.py | ansible_ansible/test/units/module_utils/urls/test_urls.py | # -*- coding: utf-8 -*-
# (c) 2018 Matt Martz <matt@sivel.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
from ansible.module_utils import urls
def test_basic_auth_header():
header = urls.basic_auth_header('user', 'passwd')
... | 933 | Python | .py | 20 | 42.6 | 92 | 0.724558 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,905 | test_split.py | ansible_ansible/test/units/module_utils/urls/test_split.py | # -*- coding: utf-8 -*-
# Copyright: Contributors to the Ansible project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import pytest
from ansible.module_utils.urls import _split_multiext
@pytest.mark.parametrize(
'name, expected'... | 2,880 | Python | .py | 65 | 38.276923 | 141 | 0.554565 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,906 | test_fetch_url.py | ansible_ansible/test/units/module_utils/urls/test_fetch_url.py | # -*- coding: utf-8 -*-
# (c) 2018 Matt Martz <matt@sivel.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import io
import socket
import sys
import http.client
import urllib.error
from http.cookiejar import Cookie
from ansible.modul... | 7,365 | Python | .py | 147 | 40.959184 | 157 | 0.63238 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,907 | test_Request.py | ansible_ansible/test/units/module_utils/urls/test_Request.py | # -*- coding: utf-8 -*-
# (c) 2018 Matt Martz <matt@sivel.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import datetime
import os
import urllib.request
import http.client
from ansible.module_utils.urls import (Request, open_url, c... | 14,644 | Python | .py | 326 | 38.257669 | 119 | 0.662746 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,908 | test_generic_urlparse.py | ansible_ansible/test/units/module_utils/urls/test_generic_urlparse.py | # -*- coding: utf-8 -*-
# (c) 2018 Matt Martz <matt@sivel.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
from ansible.module_utils.urls import generic_urlparse
from urllib.parse import urlparse, urlunparse
def test_generic_urlpars... | 880 | Python | .py | 20 | 40.25 | 92 | 0.723329 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,909 | test_fetch_file.py | ansible_ansible/test/units/module_utils/urls/test_fetch_file.py | # -*- coding: utf-8 -*-
# Copyright: Contributors to the Ansible project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import os
from ansible.module_utils.urls import fetch_file
import pytest
class FakeTemporaryFile:
def __init_... | 1,635 | Python | .py | 32 | 44.03125 | 114 | 0.662688 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,910 | test_daemon_threading.py | ansible_ansible/test/units/module_utils/_internal/_concurrent/test_daemon_threading.py | from __future__ import annotations
import threading
from ansible.module_utils._internal._concurrent import _daemon_threading
def test_daemon_thread_getattr() -> None:
"""Ensure that the threading module proxy delegates properly to the real module."""
assert _daemon_threading.current_thread is threading.curr... | 541 | Python | .py | 9 | 56.666667 | 94 | 0.78327 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,911 | test_futures.py | ansible_ansible/test/units/module_utils/_internal/_concurrent/test_futures.py | from __future__ import annotations
import concurrent.futures as _cf
import subprocess
import sys
import time
import pytest
from ansible.module_utils._internal._concurrent import _futures
def test_daemon_thread_pool_nonblocking_cm_exit() -> None:
"""Ensure that the ThreadPoolExecutor context manager exit is not... | 2,397 | Python | .py | 40 | 55.275 | 157 | 0.728051 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,912 | test_facts.py | ansible_ansible/test/units/module_utils/facts/test_facts.py | # This file is part of Ansible
# -*- coding: utf-8 -*-
#
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... | 23,266 | Python | .py | 547 | 36.427788 | 154 | 0.683582 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,913 | test_ansible_collector.py | ansible_ansible/test/units/module_utils/facts/test_ansible_collector.py | # -*- coding: utf-8 -*-
#
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it wi... | 19,996 | Python | .py | 410 | 38.307317 | 101 | 0.645203 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,914 | test_utils.py | ansible_ansible/test/units/module_utils/facts/test_utils.py | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | 1,427 | Python | .py | 30 | 43.933333 | 112 | 0.75036 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,915 | test_collector.py | ansible_ansible/test/units/module_utils/facts/test_collector.py | # This file is part of Ansible
# -*- coding: utf-8 -*-
#
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... | 25,491 | Python | .py | 446 | 41.612108 | 126 | 0.581055 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,916 | test_collectors.py | ansible_ansible/test/units/module_utils/facts/test_collectors.py | # unit tests for ansible fact collectors
# -*- coding: utf-8 -*-
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansibl... | 16,819 | Python | .py | 342 | 41.885965 | 239 | 0.684133 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,917 | test_timeout.py | ansible_ansible/test/units/module_utils/facts/test_timeout.py | # -*- coding: utf-8 -*-
# Copyright: (c) 2017, Toshio Kuratomi <tkuratomi@ansible.com>
# Copyright: Contributors to the Ansible project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import sys
import time
import pytest
from ansible.mo... | 4,742 | Python | .py | 108 | 39.944444 | 99 | 0.750763 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,918 | test_sysctl.py | ansible_ansible/test/units/module_utils/facts/test_sysctl.py | # This file is part of Ansible
# -*- coding: utf-8 -*-
#
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... | 9,000 | Python | .py | 223 | 34.838565 | 80 | 0.671616 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,919 | test_date_time.py | ansible_ansible/test/units/module_utils/facts/test_date_time.py | # -*- coding: utf-8 -*-
# Copyright (c) 2020 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import pytest
import datetime
import string
import time
from ansible.module_utils.compat.datetime import UTC
from ansible.module... | 3,236 | Python | .py | 80 | 35.1 | 108 | 0.651341 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,920 | base.py | ansible_ansible/test/units/module_utils/facts/base.py | # base unit test classes for ansible/module_utils/facts/ tests
# -*- coding: utf-8 -*-
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | 2,603 | Python | .py | 55 | 40.636364 | 100 | 0.686761 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,921 | test_fc_wwn.py | ansible_ansible/test/units/module_utils/facts/network/test_fc_wwn.py | # -*- coding: utf-8 -*-
# Copyright (c) 2019 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
from ansible.module_utils.facts.network import fc_wwn
import pytest
# AIX lsdev
LSDEV_OUTPUT = """
fcs0 Defined 00-00 8Gb PCI... | 5,041 | Python | .py | 130 | 28.523077 | 128 | 0.53543 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,922 | test_iscsi_get_initiator.py | ansible_ansible/test/units/module_utils/facts/network/test_iscsi_get_initiator.py | # -*- coding: utf-8 -*-
# Copyright (c) 2019 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
from ansible.module_utils.facts.network import iscsi
import pytest
# AIX # lsattr -E -l iscsi0
LSATTR_OUTPUT = """
disc_filenam... | 2,547 | Python | .py | 61 | 36.360656 | 98 | 0.552462 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,923 | test_generic_bsd.py | ansible_ansible/test/units/module_utils/facts/network/test_generic_bsd.py | # -*- coding: utf-8 -*-
# Copyright: Contributors to the Ansible project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import pytest
from ansible.module_utils.facts.network import generic_bsd
def mock_get_bin_path(command):
cmds ... | 7,616 | Python | .py | 190 | 26.610526 | 96 | 0.485896 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,924 | test_locally_reachable_ips.py | ansible_ansible/test/units/module_utils/facts/network/test_locally_reachable_ips.py | # Copyright: Contributors to the Ansible project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
from ansible.module_utils.facts.network import linux
# ip -4 route show table local
IP4_ROUTE_SHOW_LOCAL = """
broadcast 127.0.0.0 dev lo pr... | 1,923 | Python | .py | 50 | 34.46 | 92 | 0.687601 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,925 | test_pkg_mgr.py | ansible_ansible/test/units/module_utils/facts/system/test_pkg_mgr.py | # -*- coding: utf-8 -*-
# Copyright: (c) 2023, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
from ansible.module_utils.facts.system.pkg_mgr import PkgMgrFactCollector
_FACTS = {"ansible_os_family": "RedHat"}
# NOTE p... | 2,698 | Python | .py | 39 | 64.692308 | 102 | 0.688897 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,926 | test_user.py | ansible_ansible/test/units/module_utils/facts/system/test_user.py | # unit tests for ansible system lsb fact collectors
# -*- coding: utf-8 -*-
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... | 1,404 | Python | .py | 31 | 42.645161 | 70 | 0.75183 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,927 | test_lsb.py | ansible_ansible/test/units/module_utils/facts/system/test_lsb.py | # unit tests for ansible system lsb fact collectors
# -*- coding: utf-8 -*-
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... | 4,401 | Python | .py | 90 | 42.055556 | 190 | 0.677382 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,928 | test_fips.py | ansible_ansible/test/units/module_utils/facts/system/test_fips.py | # Copyright: Contributors to the Ansible project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import pytest
from ansible.module_utils.facts.system.fips import FipsFactCollector
@pytest.mark.parametrize(("return_value", "expected"), ... | 584 | Python | .py | 10 | 55.7 | 102 | 0.759227 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,929 | test_cmdline.py | ansible_ansible/test/units/module_utils/facts/system/test_cmdline.py | # unit tests for ansible system cmdline fact collectors
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import pytest
from ansible.module_utils.facts.system.cmdline import Cmd... | 1,945 | Python | .py | 60 | 24.183333 | 120 | 0.564662 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,930 | conftest.py | ansible_ansible/test/units/module_utils/facts/system/distribution/conftest.py | # -*- coding: utf-8 -*-
# Copyright (c) 2020 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import pytest
from unittest.mock import Mock
@pytest.fixture
def mock_module():
mock_module = Mock()
mock_module.para... | 518 | Python | .py | 14 | 30.714286 | 92 | 0.636546 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,931 | test_parse_distribution_file_ClearLinux.py | ansible_ansible/test/units/module_utils/facts/system/distribution/test_parse_distribution_file_ClearLinux.py | # -*- coding: utf-8 -*-
# Copyright (c) 2019 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import os
import pytest
from ansible.module_utils.facts.system.distribution import DistributionFiles
@pytest.fixture
def test_... | 1,706 | Python | .py | 39 | 38 | 113 | 0.680169 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,932 | test_distribution_files.py | ansible_ansible/test/units/module_utils/facts/system/distribution/test_distribution_files.py | # Copyright: Contributors to the Ansible project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import tempfile
from ansible.module_utils.facts.system.distribution import DistributionFiles
def test_distribution_files(mock_module):
... | 539 | Python | .py | 11 | 45.636364 | 92 | 0.783525 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,933 | test_parse_distribution_file_Slackware.py | ansible_ansible/test/units/module_utils/facts/system/distribution/test_parse_distribution_file_Slackware.py | # -*- coding: utf-8 -*-
# Copyright (c) 2019 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import os
import pytest
from ansible.module_utils.facts.system.distribution import DistributionFiles
@pytest.mark.parametrize(... | 1,111 | Python | .py | 32 | 29 | 113 | 0.648321 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,934 | test_distribution_sles4sap.py | ansible_ansible/test/units/module_utils/facts/system/distribution/test_distribution_sles4sap.py | # -*- coding: utf-8 -*-
# Copyright: (c) 2020 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import pytest
from ansible.module_utils.facts.system.distribution import DistributionFiles
@pytest.mark.parametrize('realpath... | 946 | Python | .py | 24 | 33.916667 | 92 | 0.66849 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,935 | test_distribution_version.py | ansible_ansible/test/units/module_utils/facts/system/distribution/test_distribution_version.py | # -*- coding: utf-8 -*-
# Copyright: (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import glob
import json
import os
import pytest
from itertools import product
import builtins
# the module we are actually tes... | 6,078 | Python | .py | 125 | 41.48 | 126 | 0.67573 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,936 | test_linux.py | ansible_ansible/test/units/module_utils/facts/virtual/test_linux.py | # -*- coding: utf-8 -*-
# Copyright (c) 2020 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
from ansible.module_utils.facts.virtual import linux
def mock_os_path_is_file_docker(filename):
if filename in ('/.dockeren... | 1,562 | Python | .py | 37 | 36.72973 | 94 | 0.674388 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,937 | test_facter.py | ansible_ansible/test/units/module_utils/facts/other/test_facter.py | # unit tests for ansible other facter fact collector
# -*- coding: utf-8 -*-
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version... | 7,974 | Python | .py | 209 | 33.789474 | 313 | 0.654362 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,938 | test_ohai.py | ansible_ansible/test/units/module_utils/facts/other/test_ohai.py | # unit tests for ansible ohai fact collector
# -*- coding: utf-8 -*-
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# An... | 158,776 | Python | .py | 6,667 | 14.837258 | 651 | 0.419722 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,939 | test_aix_processor.py | ansible_ansible/test/units/module_utils/facts/hardware/test_aix_processor.py | # -*- coding: utf-8 -*-
# Copyright (c) 2022 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
from ansible.module_utils.facts.hardware import aix
import pytest
from . aix_data import AIX_PROCESSOR_TEST_SCENARIOS
@pytest.... | 831 | Python | .py | 18 | 42.222222 | 92 | 0.695545 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,940 | test_sunos_get_uptime_facts.py | ansible_ansible/test/units/module_utils/facts/hardware/test_sunos_get_uptime_facts.py | from __future__ import annotations
import time
from ansible.module_utils.facts.hardware import sunos
def test_sunos_get_uptime_facts(mocker):
kstat_output = '\nunix:0:system_misc:boot_time\t1548249689\n'
module_mock = mocker.patch('ansible.module_utils.basic.AnsibleModule')
module = module_mock()
mo... | 608 | Python | .py | 13 | 42.538462 | 74 | 0.73854 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,941 | test_linux.py | ansible_ansible/test/units/module_utils/facts/hardware/test_linux.py | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | 8,826 | Python | .py | 160 | 45.43125 | 159 | 0.647816 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,942 | test_linux_get_cpu_info.py | ansible_ansible/test/units/module_utils/facts/hardware/test_linux_get_cpu_info.py | # -*- coding: utf-8 -*-
# Copyright (c) 2019 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
from ansible.module_utils.facts.hardware import linux
from . linux_data import CPU_INFO_TEST_SCENARIOS
def test_get_cpu_info(m... | 2,661 | Python | .py | 44 | 54 | 115 | 0.696923 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,943 | linux_data.py | ansible_ansible/test/units/module_utils/facts/hardware/linux_data.py | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | 28,061 | Python | .py | 689 | 31.162554 | 154 | 0.549662 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,944 | aix_data.py | ansible_ansible/test/units/module_utils/facts/hardware/aix_data.py | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | 2,813 | Python | .py | 71 | 30.802817 | 75 | 0.608251 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,945 | test_darwin_facts.py | ansible_ansible/test/units/module_utils/facts/hardware/test_darwin_facts.py | # Copyright: Contributors to the Ansible project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import pathlib
from ansible.module_utils.facts.hardware import darwin
from ansible.module_utils.facts.sysctl import get_sysctl
import pytest... | 3,149 | Python | .py | 70 | 36.142857 | 92 | 0.621331 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,946 | test_get_device_facts.py | ansible_ansible/test/units/module_utils/facts/hardware/freebsd/test_get_device_facts.py | # Copyright: Contributors to the Ansible project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import json
import os
import pathlib
from ansible.module_utils.facts.hardware import freebsd
def test_get_device_facts(monkeypatch):
f... | 761 | Python | .py | 16 | 44.125 | 92 | 0.741192 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,947 | test_get_sysinfo_facts.py | ansible_ansible/test/units/module_utils/facts/hardware/linux/test_get_sysinfo_facts.py | # Copyright: Contributors to the Ansible project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import os
import pathlib
from ansible.module_utils.facts.hardware import linux
def test_get_sysinfo_facts(monkeypatch):
fixtures = pat... | 824 | Python | .py | 21 | 34.285714 | 92 | 0.683417 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,948 | test_datetime.py | ansible_ansible/test/units/module_utils/compat/test_datetime.py | from __future__ import annotations
import datetime
from ansible.module_utils.compat.datetime import utcnow, utcfromtimestamp, UTC
def test_utc():
assert UTC.tzname(None) == 'UTC'
assert UTC.utcoffset(None) == datetime.timedelta(0)
assert UTC.dst(None) is None
def test_utcnow():
assert utcnow().tzi... | 607 | Python | .py | 19 | 27.736842 | 78 | 0.704663 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,949 | test_filter_non_json_lines.py | ansible_ansible/test/units/module_utils/json_utils/test_filter_non_json_lines.py | # -*- coding: utf-8 -*-
# (c) 2016, Matt Davis <mdavis@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your o... | 2,918 | Python | .py | 74 | 32.081081 | 111 | 0.616961 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,950 | test_cli.py | ansible_ansible/test/units/cli/test_cli.py | # (c) 2017, Adrian Likins <alikins@redhat.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later vers... | 17,421 | Python | .py | 293 | 42.030717 | 106 | 0.561364 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,951 | test_playbook.py | ansible_ansible/test/units/cli/test_playbook.py | # (c) 2016, Adrian Likins <alikins@redhat.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later vers... | 1,658 | Python | .py | 35 | 43.714286 | 83 | 0.754647 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,952 | test_doc.py | ansible_ansible/test/units/cli/test_doc.py | from __future__ import annotations
import pytest
from ansible import constants as C
from ansible.cli.doc import DocCLI, RoleMixin
from ansible.plugins.loader import module_loader, init_plugin_loader
C.ANSIBLE_NOCOLOR = True
TTY_IFY_DATA = {
# No substitutions
'no-op': 'no-op',
'no-op Z(test)': 'no-op Z(... | 4,730 | Python | .py | 115 | 35.713043 | 134 | 0.647008 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,953 | test_vault.py | ansible_ansible/test/units/cli/test_vault.py | # -*- coding: utf-8 -*-
# (c) 2017, Adrian Likins <alikins@redhat.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at you... | 11,012 | Python | .py | 214 | 42.373832 | 109 | 0.640249 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,954 | test_console.py | ansible_ansible/test/units/cli/test_console.py | # (c) 2016, Thilo Uttendorfer <tlo@sengaya.de>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later vers... | 1,723 | Python | .py | 42 | 35.857143 | 78 | 0.701912 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,955 | test_adhoc.py | ansible_ansible/test/units/cli/test_adhoc.py | # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import pytest
import re
from ansible import context
from ansible.cli.adhoc import AdHocCLI, display
from ansible.errors import ... | 4,723 | Python | .py | 86 | 50.139535 | 145 | 0.676062 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,956 | test_galaxy.py | ansible_ansible/test/units/cli/test_galaxy.py | # -*- coding: utf-8 -*-
# (c) 2016, Adrian Likins <alikins@redhat.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at you... | 58,956 | Python | .py | 1,046 | 49.573614 | 150 | 0.676816 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,957 | test_optparse_helpers.py | ansible_ansible/test/units/cli/arguments/test_optparse_helpers.py | # -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import sys
import pytest
from ansible import constants as C
from ansible.cli.arguments import option_helpers as opt_help
from... | 1,077 | Python | .py | 26 | 37.5 | 92 | 0.696069 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,958 | test_display_header.py | ansible_ansible/test/units/cli/galaxy/test_display_header.py | # -*- coding: utf-8 -*-
# Copyright (c) 2020 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
from ansible.cli.galaxy import _display_header
def test_display_header_default(capsys):
_display_header('/collections/path'... | 1,307 | Python | .py | 29 | 40.793103 | 92 | 0.609313 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,959 | test_display_role.py | ansible_ansible/test/units/cli/galaxy/test_display_role.py | # -*- coding: utf-8 -*-
# Copyright (c) 2020 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
from ansible.cli.galaxy import _display_role
def test_display_role(mocker, capsys):
mocked_galaxy_role = mocker.Mock(instal... | 862 | Python | .py | 19 | 41.421053 | 92 | 0.705389 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,960 | test_collection_extract_tar.py | ansible_ansible/test/units/cli/galaxy/test_collection_extract_tar.py | # -*- coding: utf-8 -*-
# Copyright (c) 2020 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import pytest
from ansible.galaxy.collection import _extract_tar_dir
@pytest.fixture
def fake_tar_obj(mocker):
m_tarfile =... | 1,167 | Python | .py | 25 | 42.72 | 92 | 0.715426 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,961 | test_display_collection.py | ansible_ansible/test/units/cli/galaxy/test_display_collection.py | # -*- coding: utf-8 -*-
# Copyright (c) 2020 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import pytest
from ansible.cli.galaxy import _display_collection
from ansible.galaxy.dependency_resolution.dataclasses import Re... | 1,347 | Python | .py | 28 | 44.214286 | 92 | 0.714286 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,962 | test_execute_list_collection.py | ansible_ansible/test/units/cli/galaxy/test_execute_list_collection.py | # -*- coding: utf-8 -*-
# Copyright (c) 2020 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import pathlib
import pytest
from ansible import constants as C
from ansible import context
from ansible.cli.galaxy import Gala... | 9,698 | Python | .py | 183 | 46.693989 | 120 | 0.690959 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,963 | test_get_collection_widths.py | ansible_ansible/test/units/cli/galaxy/test_get_collection_widths.py | # -*- coding: utf-8 -*-
# Copyright (c) 2020 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import pytest
from ansible.cli.galaxy import _get_collection_widths
from ansible.galaxy.dependency_resolution.dataclasses import... | 1,135 | Python | .py | 20 | 53.3 | 92 | 0.746824 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,964 | test_execute_list.py | ansible_ansible/test/units/cli/galaxy/test_execute_list.py | # -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# Copyright (c) 2020 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import pytest
from ansible import context
from ansible.cli.galaxy import GalaxyCLI
def test_execute_li... | 1,683 | Python | .py | 28 | 55.857143 | 155 | 0.740876 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,965 | test_errors.py | ansible_ansible/test/units/errors/test_errors.py | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | 6,799 | Python | .py | 120 | 46.641667 | 155 | 0.628778 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,966 | test_play_iterator.py | ansible_ansible/test/units/executor/test_play_iterator.py | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | 17,149 | Python | .py | 392 | 32.954082 | 105 | 0.590702 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,967 | test_task_result.py | ansible_ansible/test/units/executor/test_task_result.py | # (c) 2016, James Cammarata <jimi@sngx.net>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version... | 6,478 | Python | .py | 136 | 39.389706 | 132 | 0.647171 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,968 | test_interpreter_discovery.py | ansible_ansible/test/units/executor/test_interpreter_discovery.py | # -*- coding: utf-8 -*-
# (c) 2019, Jordan Borean <jborean@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import pytest
from unittest.mock import MagicMock
from ansible.executor.interpreter_discovery import discover_interpre... | 4,381 | Python | .py | 65 | 62.046154 | 125 | 0.723539 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,969 | test_task_executor.py | ansible_ansible/test/units/executor/test_task_executor.py | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | 17,489 | Python | .py | 411 | 31.907543 | 123 | 0.592675 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,970 | test_playbook_executor.py | ansible_ansible/test/units/executor/test_playbook_executor.py | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | 6,367 | Python | .py | 127 | 40.874016 | 157 | 0.603601 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,971 | test_task_queue_manager_callbacks.py | ansible_ansible/test/units/executor/test_task_queue_manager_callbacks.py | # (c) 2016, Steve Kuznetsov <skuznets@redhat.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later v... | 4,395 | Python | .py | 98 | 36.295918 | 84 | 0.66542 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,972 | conftest.py | ansible_ansible/test/units/executor/module_common/conftest.py | from __future__ import annotations
import pytest
@pytest.fixture
def templar():
class FakeTemplar:
def template(self, template_string, *args, **kwargs):
return template_string
return FakeTemplar()
| 229 | Python | .py | 8 | 23.625 | 61 | 0.709677 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,973 | test_recursive_finder.py | ansible_ansible/test/units/executor/module_common/test_recursive_finder.py | # (c) 2017, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later... | 6,777 | Python | .py | 105 | 49.895238 | 146 | 0.605623 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,974 | test_modify_module.py | ansible_ansible/test/units/executor/module_common/test_modify_module.py | # Copyright (c) 2018 Matt Martz <matt@sivel.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# -*- coding: utf-8 -*-
from __future__ import annotations
import pytest
from ansible.executor.module_common import modify_module
FAKE_OLD_MODULE = b"""#!/usr/bin/python
imp... | 1,179 | Python | .py | 25 | 44.44 | 109 | 0.712161 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,975 | test_module_common.py | ansible_ansible/test/units/executor/module_common/test_module_common.py | # (c) 2017, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later... | 7,457 | Python | .py | 148 | 43.466216 | 140 | 0.663368 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,976 | test_invalid_var_names.py | ansible_ansible/test/units/regex/test_invalid_var_names.py | from __future__ import annotations
import unittest
from ansible import constants as C
test_cases = (('not-valid', ['-'], 'not_valid'), ('not!valid@either', ['!', '@'], 'not_valid_either'), ('1_nor_This', ['1'], '__nor_This'))
class TestInvalidVars(unittest.TestCase):
def test_positive_matches(self):
... | 789 | Python | .py | 14 | 49.428571 | 139 | 0.664921 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,977 | test_native_concat.py | ansible_ansible/test/units/template/test_native_concat.py | # Copyright: (c) 2019, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
from ansible.playbook.conditional import Conditional
from ansible.template import Templar
from units.mock.loader import DictDataLoader
def test_cond... | 814 | Python | .py | 17 | 43.941176 | 92 | 0.757269 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,978 | test_templar.py | ansible_ansible/test/units/template/test_templar.py | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | 18,870 | Python | .py | 381 | 38.965879 | 133 | 0.595298 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,979 | test_vars.py | ansible_ansible/test/units/template/test_vars.py | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | 1,121 | Python | .py | 26 | 41.115385 | 79 | 0.751148 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,980 | test_template_utilities.py | ansible_ansible/test/units/template/test_template_utilities.py | # (c) 2015 Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ... | 4,277 | Python | .py | 92 | 38.847826 | 121 | 0.627823 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,981 | conftest.py | ansible_ansible/test/units/ansible_test/conftest.py | from __future__ import annotations
import os
import pytest
import sys
@pytest.fixture(autouse=True, scope='session')
def ansible_test():
"""Make ansible_test available on sys.path for unit testing ansible-test."""
test_lib = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'lib')
... | 351 | Python | .py | 9 | 36.222222 | 95 | 0.733728 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,982 | test_diff.py | ansible_ansible/test/units/ansible_test/test_diff.py | """Tests for the diff module."""
from __future__ import annotations
import pathlib
import pytest
import typing as t
if t.TYPE_CHECKING: # pragma: nocover
# noinspection PyProtectedMember
from ansible_test._internal.diff import FileDiff
@pytest.fixture()
def diffs(request: pytest.FixtureRequest) -> list[Fil... | 4,798 | Python | .py | 116 | 36.103448 | 104 | 0.684199 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,983 | util.py | ansible_ansible/test/units/ansible_test/ci/util.py | from __future__ import annotations
import base64
import json
import re
def common_auth_test(auth):
private_key_pem = auth.initialize_private_key()
public_key_pem = auth.public_key_pem
extract_pem_key(private_key_pem, private=True)
extract_pem_key(public_key_pem, private=False)
request = dict(he... | 1,541 | Python | .py | 33 | 41.666667 | 109 | 0.705567 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,984 | test_azp.py | ansible_ansible/test/units/ansible_test/ci/test_azp.py | from __future__ import annotations
from .util import common_auth_test
def test_auth():
# noinspection PyProtectedMember
from ansible_test._internal.ci.azp import (
AzurePipelinesAuthHelper,
)
class TestAzurePipelinesAuthHelper(AzurePipelinesAuthHelper):
def __init__(self):
... | 840 | Python | .py | 21 | 31.142857 | 66 | 0.65679 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,985 | test_plugins.py | ansible_ansible/test/units/plugins/test_plugins.py | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | 5,325 | Python | .py | 106 | 42.839623 | 103 | 0.643242 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,986 | test_script.py | ansible_ansible/test/units/plugins/inventory/test_script.py | # -*- coding: utf-8 -*-
# Copyright 2017 Chris Meyers <cmeyers@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (... | 4,584 | Python | .py | 85 | 45.270588 | 135 | 0.680556 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,987 | test_constructed.py | ansible_ansible/test/units/plugins/inventory/test_constructed.py | # -*- coding: utf-8 -*-
# Copyright 2019 Alan Rominger <arominge@redhat.net>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... | 12,028 | Python | .py | 302 | 32.913907 | 101 | 0.650017 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,988 | test_inventory.py | ansible_ansible/test/units/plugins/inventory/test_inventory.py | # Copyright 2015 Abhijit Menon-Sen <ams@2ndQuadrant.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | 7,423 | Python | .py | 170 | 35.229412 | 113 | 0.564699 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,989 | conftest.py | ansible_ansible/test/units/plugins/become/conftest.py | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2017 Ansible Project
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import pytest
from ansible.cli.arguments import option_helpers as opt_help
from ansible.utils import ... | 956 | Python | .py | 26 | 33.269231 | 92 | 0.757872 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,990 | test_su.py | ansible_ansible/test/units/plugins/become/test_su.py | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2020 Ansible Project
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import re
from ansible import context
from ansible.plugins.loader import become_loader, shell_loader
... | 792 | Python | .py | 20 | 35.6 | 103 | 0.670157 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,991 | test_sudo.py | ansible_ansible/test/units/plugins/become/test_sudo.py | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2020 Ansible Project
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import re
from ansible import context
from ansible.plugins.loader import become_loader, shell_loader
... | 2,245 | Python | .py | 48 | 41 | 160 | 0.604128 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,992 | test_raw.py | ansible_ansible/test/units/plugins/action/test_raw.py | # (c) 2016, Saran Ahluwalia <ahlusar.ahluwalia@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any... | 3,395 | Python | .py | 68 | 44.088235 | 128 | 0.707753 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,993 | test_action.py | ansible_ansible/test/units/plugins/action/test_action.py | # -*- coding: utf-8 -*-
# (c) 2015, Florian Apolloner <florian@apolloner.eu>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (... | 34,598 | Python | .py | 728 | 37.135989 | 157 | 0.614486 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,994 | test_gather_facts.py | ansible_ansible/test/units/plugins/action/test_gather_facts.py | # (c) 2016, Saran Ahluwalia <ahlusar.ahluwalia@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any... | 3,680 | Python | .py | 77 | 41.701299 | 140 | 0.705275 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,995 | test_reboot.py | ansible_ansible/test/units/plugins/action/test_reboot.py | # Copyright (c) 2022 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""Tests for the reboot action plugin."""
from __future__ import annotations
import os
import pytest
from ansible.errors import AnsibleConnectionFailure
from ansible.playbook.task import ... | 6,718 | Python | .py | 178 | 30.561798 | 92 | 0.633231 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,996 | test_paramiko_ssh.py | ansible_ansible/test/units/plugins/connection/test_paramiko_ssh.py | #
# (c) 2020 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | 1,756 | Python | .py | 43 | 37.953488 | 81 | 0.77 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,997 | test_ssh.py | ansible_ansible/test/units/plugins/connection/test_ssh.py | # -*- coding: utf-8 -*-
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (a... | 30,734 | Python | .py | 557 | 45.969479 | 144 | 0.64407 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,998 | test_connection.py | ansible_ansible/test/units/plugins/connection/test_connection.py | # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later... | 5,919 | Python | .py | 107 | 49.841121 | 320 | 0.721694 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |
13,999 | test_psrp.py | ansible_ansible/test/units/plugins/connection/test_psrp.py | # -*- coding: utf-8 -*-
# (c) 2018, Jordan Borean <jborean@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import pytest
import sys
import typing as t
from io import StringIO
from unittest.mock import MagicMock
from ansible.... | 7,302 | Python | .py | 196 | 23.581633 | 92 | 0.468322 | ansible/ansible | 62,258 | 23,791 | 861 | GPL-3.0 | 9/5/2024, 5:11:58 PM (Europe/Amsterdam) |