Beispiel #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"
Beispiel #2
0
 def test_glibc_version_string_confstr_missing(self, monkeypatch):
     monkeypatch.delattr(os, "confstr", raising=False)
     assert glibc_version_string_confstr() is None
Beispiel #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
Beispiel #4
0
 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