コード例 #1
0
def test_langpack_id():
    filename = os.path.join(TEST_DATA_DIR, "en-CA.xpi")
    langpack_app = App(orig_path=filename,
                       formats=["autograph_langpack"],
                       artifact_prefix="public/")
    assert autograph.langpack_id(
        langpack_app) == "*****@*****.**"
コード例 #2
0
def test_langpack_id():
    filename = os.path.join(TEST_DATA_DIR, "en-CA.exe")
    langpack_app = App(orig_path=filename,
                       formats=["autograph_langpack"],
                       artifact_prefix="public/")
    with pytest.raises(IScriptError):
        assert autograph.langpack_id(
            langpack_app) == "*****@*****.**"
コード例 #3
0
def test_langpack_id_raises(json_, raises, mocker):
    filename = os.path.join(TEST_DATA_DIR, "en-CA.xpi")
    langpack_app = App(orig_path=filename, formats=["autograph_langpck"], artifact_prefix="public/")

    def load_manifest(*args, **kwargs):
        return json_

    # Mock ZipFile so we don't actually read the xpi data
    mocker.patch.object(autograph.zipfile, "ZipFile", autospec=True)

    mocker.patch.object(autograph.json, "load", load_manifest)
    with raises:
        id = autograph.langpack_id(langpack_app)
        assert id == json_["applications"]["gecko"]["id"]