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