Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: tests/test_packagerWebExt.py

Issue 29747571: Issue 6563 - Assure devbuild-number in info module (Closed) Base URL: https://hg.adblockplus.org/buildtools/file/a3db4a1a49e8
Patch Set: Created April 9, 2018, 9:57 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « packagerChrome.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/test_packagerWebExt.py
diff --git a/tests/test_packagerWebExt.py b/tests/test_packagerWebExt.py
index cef155e087e19c051f467f7b64773c6e0f9bff7b..4c617d0c73f664e3e1f51212f295592e34c8d343 100644
--- a/tests/test_packagerWebExt.py
+++ b/tests/test_packagerWebExt.py
@@ -228,7 +228,7 @@ def keyfile(tmpdir):
@pytest.fixture
def lib_files(tmpdir):
files = packager.Files(['lib'], set())
- files['ext/a.js'] = 'require("./c.js");\nvar bar;'
+ files['ext/a.js'] = 'require("./c.js");\nrequire("info");\nvar bar;'
files['lib/b.js'] = 'var foo;'
files['ext/c.js'] = 'var this_is_c;'
files['qunit/common.js'] = 'var qunit = {};'
@@ -285,11 +285,16 @@ def assert_manifest_content(manifest, expected_path):
assert len(diff) == 0, '\n'.join(diff)
-def assert_webpack_bundle(package, prefix, excluded=False):
+def assert_webpack_bundle(package, prefix, is_devbuild, excluded=False):
libfoo = package.read(os.path.join(prefix, 'lib/foo.js'))
libfoomap = package.read(os.path.join(prefix, 'lib/foo.js.map'))
assert 'var bar;' in libfoo
+ if is_devbuild:
+ assert 'addonVersion = "1.2.3.1337";' in libfoo
+ else:
+ assert 'addonVersion = "1.2.3";' in libfoo
+
assert 'webpack:///./ext/a.js' in libfoomap
assert 'var this_is_c;' in libfoo
@@ -456,7 +461,8 @@ def test_build_webext(platform, command, keyfile, tmpdir, srcdir, capsys):
with content_class(out_file_path) as package:
assert_base_files(package, platform, prefix)
assert_all_locales_present(package, prefix)
- assert_webpack_bundle(package, prefix, platform == 'gecko')
+ assert_webpack_bundle(package, prefix, not release and not devenv,
+ platform == 'gecko')
if platform == 'chrome':
assert_locale_upfix(package)
« no previous file with comments | « packagerChrome.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld