예제 #1
0
 def test_glibc_version_string_confstr(self, monkeypatch):
     monkeypatch.setattr(
         os,
         "confstr",
         lambda x: "glibc 2.20",
         raising=False,
     )
     assert glibc_version_string_confstr() == "2.20"
예제 #2
0
 def test_glibc_version_string_confstr_missing(self, monkeypatch):
     monkeypatch.delattr(os, "confstr", raising=False)
     assert glibc_version_string_confstr() is None
예제 #3
0
 def test_glibc_version_string_confstr_fail(self, monkeypatch, failure):
     monkeypatch.setattr(os, "confstr", failure, raising=False)
     assert glibc_version_string_confstr() is None
예제 #4
0
파일: test_utils.py 프로젝트: pradyunsg/pip
 def test_glibc_version_string_confstr_fail(
         self, monkeypatch: pytest.MonkeyPatch,
         failure: Callable[[Any], Any]) -> None:
     monkeypatch.setattr(os, "confstr", failure, raising=False)
     assert glibc_version_string_confstr() is None