MCPcopy Create free account
hub / github.com/conda/constructor / test_example_osxpkg

Function test_example_osxpkg

tests/test_examples.py:887–915  ·  view source on GitHub ↗
(tmp_path, request)

Source from the content-addressed store, hash-verified

885
886@pytest.mark.skipif(sys.platform != "darwin", reason="macOS only")
887def test_example_osxpkg(tmp_path, request):
888 input_path = _example_path("osxpkg")
889 ownership_test_files_home = [
890 ".bash_profile",
891 ".conda",
892 ".condarc",
893 ".config",
894 ".config/fish",
895 ".config/fish/fish.config",
896 ".config/powershell",
897 ".config/powershell/profile.ps1",
898 ".tcshrc",
899 ".xonshrc",
900 ".zshrc",
901 ]
902 ownership_test_files_home = [Path.home() / file for file in ownership_test_files_home]
903 # getpass.getuser is more reliable than os.getlogin:
904 # https://docs.python.org/3/library/os.html#os.getlogin
905 expected_owner = getpass.getuser()
906 for installer, install_dir in create_installer(input_path, tmp_path):
907 _run_installer(input_path, installer, install_dir, request=request)
908 expected = {}
909 found = {}
910 for file in ownership_test_files_home:
911 if not file.exists():
912 continue
913 expected[file] = expected_owner
914 found[file] = file.owner()
915 assert expected == found
916
917
918@pytest.mark.skipif(sys.platform != "darwin", reason="macOS only")

Callers

nothing calls this directly

Calls 3

_example_pathFunction · 0.85
create_installerFunction · 0.85
_run_installerFunction · 0.85

Tested by

no test coverage detected