@pytest.mark.skipif(
mozinfo.isWin,
reason="Bug 1157352 - New firefox.exe needed for mozinstall 1.12 and higher.",
) def test_is_installer(request, get_installer): """Test that we can identify a correct installer.""" if mozinfo.isLinux: assert mozinstall.is_installer(get_installer("tar.xz"))
if mozinfo.isWin: # test zip installer assert mozinstall.is_installer(get_installer("zip"))
# test exe installer assert mozinstall.is_installer(get_installer("exe"))
try: # test stub browser file # without pefile on the system this test will fail import pefile # noqa
if mozinfo.isMac: assert mozinstall.is_installer(get_installer("dmg"))
def test_invalid_source_error(get_installer): """Test that InvalidSource error is raised with an incorrect installer.""" if mozinfo.isLinux: with pytest.raises(mozinstall.InvalidSource):
mozinstall.install(get_installer("dmg"), "firefox")
elif mozinfo.isWin: with pytest.raises(mozinstall.InvalidSource):
mozinstall.install(get_installer("tar.xz"), "firefox")
elif mozinfo.isMac: with pytest.raises(mozinstall.InvalidSource):
mozinstall.install(get_installer("tar.xz"), "firefox")
# Test an invalid url handler with pytest.raises(mozinstall.InvalidSource):
mozinstall.install("file://foo.bar", "firefox")
@pytest.mark.skipif(
mozinfo.isWin,
reason="Bug 1157352 - New firefox.exe needed for mozinstall 1.12 and higher.",
) def test_install(tmpdir, get_installer): """Test to install an installer.""" if mozinfo.isLinux:
installdir = mozinstall.install(get_installer("tar.xz"), tmpdir.strpath) assert installdir == tmpdir.join("firefox").strpath
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.