def test_compass(self): Packer(op.join(self.folder, 'compass.scss'), FakeArgs()).pack() self.assertEqual( open(op.join(self.folder, '_compass.scss')).read(), open(op.join(self.folder, '_compass.scss.orig')).read() )
def test_blueprint(self): Packer(op.join(self.folder, 'blueprint.css'), FakeArgs()).pack() self.assertEqual( open(op.join(self.folder, '_blueprint.css')).read(), open(op.join(self.folder, '_blueprint.css.orig')).read() )
def test_boilerplate(self): Packer(op.join(self.folder, 'boilerplate.css'), FakeArgs()).pack() self.assertEqual( open(op.join(self.folder, '_boilerplate.css')).read(), open(op.join(self.folder, '_boilerplate.css.orig')).read() )
def test_jquery(self): Packer(op.join(self.folder, 'jquery.js'), FakeArgs()).pack() self.assertEqual( open(op.join(self.folder, '_jquery.js')).read(), open(op.join(self.folder, '_jquery.js.orig')).read() )
def test_underscore(self): Packer(op.join(self.folder, 'underscore.js'), FakeArgs()).pack() self.assertEqual( open(op.join(self.folder, '_underscore.js')).read(), open(op.join(self.folder, '_underscore.js.orig')).read() )
def pack(args): " Pack files. " from zetalibrary.packer import Packer args = parse_config(args) for path in gen_files(args.source, prefix=args.prefix): Packer(path, args).pack()
def test_pack(self): css_file = op.join(self.folder, 'main.css') Packer(css_file, FakeArgs( output=op.join(BASEDIR, 'common', 'output'), compress=True)).pack() orig = open(op.join(self.folder, '_main.css.orig')).read() test = open(op.join(self.folder, 'output/_main.css')).read() self.assertEqual(test, orig) js_file = op.join(self.folder, 'main.js') Packer(js_file, FakeArgs( output=op.join(BASEDIR, 'common', 'output'), compress=True)).pack() orig = open(op.join(self.folder, '_main.js.orig')).read() test = open(op.join(self.folder, 'output/_main.js')).read() self.assertEqual(test, orig)
def test_custom_libs(self): js_file = op.join(BASEDIR, 'custom', 'custom.js') Packer(js_file, FakeArgs( directory=op.join(BASEDIR, 'custom'), )).pack() self.assertTrue( 'fake' in open(op.join(BASEDIR, 'custom', '_custom.js')).read())
def test_zeta(self): css_file = op.join(self.folder, 'main.css') packer = Packer(css_file, FakeArgs()) packer.pack() orig = open(op.join(self.folder, '_main.css.orig')).read() test = open(op.join(self.folder, '_main.css')).read() self.assertEqual(test, orig) js_file = op.join(self.folder, 'main.js') packer = Packer(js_file, FakeArgs()) packer.pack() orig = open(op.join(self.folder, '_main.js.orig')).read() test = open(op.join(self.folder, '_main.js')).read() self.assertEqual(test, orig)
def test_zeta(self): css_file = op.join(self.folder, "main.css") packer = Packer(css_file, FakeArgs()) packer.pack() orig = open(op.join(self.folder, "_main.css.orig")).read() test = open(op.join(self.folder, "_main.css")).read() self.assertEqual(test, orig) js_file = op.join(self.folder, "main.js") packer = Packer(js_file, FakeArgs()) packer.pack() orig = open(op.join(self.folder, "_main.js.orig")).read() test = open(op.join(self.folder, "_main.js")).read() self.assertEqual(test, orig)