2
# Copyright 2010 Canonical Ltd. This software is licensed under the
3
# GNU Affero General Public License version 3 (see the file LICENSE).
5
"""Script to check the size of the generated javascript.
7
This script tests to ensure optimized javascript never gets over a certain
8
size. If it gets too big, Windmill has issues. This is a hack until we can
9
find out why Windmill has such issues.
15
FILE_NAME = 'lib/canonical/launchpad/icing/build/launchpad.js'
16
MAX_FILE_SIZE = 512 * 1024
19
size = os.path.getsize(FILE_NAME)
20
if size > MAX_FILE_SIZE:
22
'launchpad.js is greater than %d bytes' % MAX_FILE_SIZE)