コード例 #1
0
 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()
     )
コード例 #2
0
 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()
     )
コード例 #3
0
 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()
     )
コード例 #4
0
 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()
     )
コード例 #5
0
 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()
     )
コード例 #6
0
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()
コード例 #7
0
    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)
コード例 #8
0
 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())
コード例 #9
0
    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)
コード例 #10
0
ファイル: zeta.py プロジェクト: klen/zeta-library
    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)