Beispiel #1
0
 def test_sass_import(self):
     """Test referencing other files in sass.
     """
     sass = get_filter('sass', debug_info=False)
     self.create_files({'import-test.sass': '''@import foo.sass'''})
     self.mkbundle('import-test.sass', filters=sass, output='out.css').build()
     assert doctest_match("""/* line 1, ...foo.sass */\nh1 {\n  font-family: "Verdana";\n  color: white;\n}\n""", self.get('out.css'))
Beispiel #2
0
 def test_images_url(self):
     # [bug] Make sure the compass plugin outputs the correct urls to images
     # when using the image-url helper.
     self.env.url = 'http://assets.host.com/the-images'
     self.create_files({'imguri.scss': 'h1 { background: image-url("test.png") }'})
     self.mkbundle('imguri.scss', filters='compass', output='out.css').build()
     assert doctest_match("""/* ... */\nh1 {\n  background: url('http://assets.host.com/the-images/test.png');\n}\n""", self.get('out.css'))
Beispiel #3
0
 def test_sass_import(self):
     """Test referencing other files in sass.
     """
     sass = get_filter('sass', debug_info=False)
     self.create_files({'import-test.sass': '''@import foo.sass'''})
     self.mkbundle('import-test.sass', filters=sass, output='out.css').build()
     assert doctest_match("""/* line 1, ...foo.sass */\nh1 {\n  font-family: "Verdana";\n  color: white;\n}\n""", self.get('out.css'))
Beispiel #4
0
 def test_images_url(self):
     # [bug] Make sure the compass plugin outputs the correct urls to images
     # when using the image-url helper.
     self.env.url = 'http://assets.host.com/the-images'
     self.create_files({'imguri.scss': 'h1 { background: image-url("test.png") }'})
     self.mkbundle('imguri.scss', filters='compass', output='out.css').build()
     assert doctest_match("""/* ... */\nh1 {\n  background: url('http://assets.host.com/the-images/test.png');\n}\n""", self.get('out.css'))
Beispiel #5
0
 def test_images_dir(self):
     # [bug] Make sure the compass plugin can reference images. It expects
     # paths to be relative to env.directory.
     self.create_files({"datauri.scss": 'h1 { background: inline-image("test.png") }', "test.png": "foo"})
     self.mkbundle("datauri.scss", filters="compass", output="out.css").build()
     assert doctest_match(
         """/* ... */\nh1 {\n  background: url('data:image/png;base64,Zm9v');\n}\n""", self.get("out.css")
     )
Beispiel #6
0
    def test_assets(self):
        try:
            import PIL
        except ImportError:
            pass
        self.create_files({"noise.scss": "h1 {background: background-noise()}"})
        self.mkbundle("noise.scss", filters="pyscss", output="out.css").build()

        assert doctest_match('/* ... */\nh1 {\n  background: url("...png");\n}\n\n', self.get("out.css"))
Beispiel #7
0
 def test_sass_import(self):
     """Test referencing other files in sass.
     """
     sass = get_filter("sass", debug_info=False)
     self.create_files({"import-test.sass": """@import foo.sass"""})
     self.mkbundle("import-test.sass", filters=sass, output="out.css").build()
     print repr(self.get("out.css"))
     assert doctest_match(
         """/* line 1, ...foo.sass */\nh1 {\n  font-family: "Verdana";\n  color: white;\n}\n""", self.get("out.css")
     )
Beispiel #8
0
    def test_assets(self):
        try:
            import PIL
        except ImportError:
            pass
        self.create_files({'noise.scss': 'h1 {background: background-noise()}'})
        self.mkbundle('noise.scss', filters='pyscss', output='out.css').build()

        assert doctest_match(
            '/* ... */\nh1 {\n  background: url("...png");\n}\n\n',
            self.get('out.css'),)
Beispiel #9
0
    def test_assets(self):
        try:
            import PIL
        except ImportError:
            pass
        self.create_files({'noise.scss': 'h1 {background: background-noise()}'})
        self.mkbundle('noise.scss', filters='pyscss', output='out.css').build()

        assert doctest_match(
            '/* ... */\nh1 {\n  background: url("...png");\n}\n\n',
            self.get('out.css'),)
 def test_images_dir(self):
     # [bug] Make sure the compass plugin can reference images. It expects
     # paths to be relative to env.directory.
     self.create_files({
         'datauri.scss': 'h1 { background: inline-image("test.png") }',
         'test.png': 'foo'
     })
     self.mkbundle('datauri.scss', filters='compass',
                   output='out.css').build()
     assert doctest_match(
         """/* ... */\nh1 {\n  background: url('data:image/png;base64,Zm9v');\n}\n""",
         self.get('out.css'))
Beispiel #11
0
    def test_assets(self):
        try:
            import PIL

            # Travis does not support PNG files, see
            # https://github.com/travis-ci/travis-ci/issues/746
            from PIL import Image

            Image.new("RGB", (10, 10)).save(StringIO(), "png")
        except (ImportError, IOError):
            raise SkipTest()
        self.create_files({"noise.scss": "h1 {background: background-noise()}"})
        self.mkbundle("noise.scss", filters="pyscss", output="out.css").build()

        assert doctest_match('h1 {\n  background: url("...png");\n}\n', self.get("out.css"))
Beispiel #12
0
    def test_assets(self):
        try:
            import PIL
            # Travis does not support PNG files, see
            # https://github.com/travis-ci/travis-ci/issues/746
            from PIL import Image
            Image.new('RGB', (10,10)).save(StringIO(), 'png')
        except (ImportError, IOError):
            raise SkipTest()
        self.create_files({'noise.scss': 'h1 {background: background-noise()}'})
        self.mkbundle('noise.scss', filters='pyscss', output='out.css').build()

        assert doctest_match(
            'h1 {\n  background: url("...png");\n}\n',
            self.get('out.css'),)
Beispiel #13
0
 def test_compass(self):
     self.mkbundle('foo.sass', filters='compass', output='out.css').build()
     assert doctest_match("""/* ... */\nh1 {\n  font-family: "Verdana";\n  color: white;\n}\n""", self.get('out.css'))
Beispiel #14
0
 def test_compass_with_scss(self):
     # [bug] test compass with scss files
     self.mkbundle('foo.scss', filters='compass', output='out.css').build()
     assert doctest_match("""/* ... */\nh1 {\n  font-family: "Verdana";\n  color: #FFFFFF;\n}\n""", self.get('out.css'))
Beispiel #15
0
 def test_compass_with_imports(self):
     self.mkbundle('import.scss', filters='compass', output='out.css').build()
     assert doctest_match("""/* ... */\nh1 {\n  font-family: "Verdana";\n  color: #FFFFFF;\n}\n""", self.get('out.css'))
Beispiel #16
0
 def test_compass(self):
     self.mkbundle('foo.sass', filters='compass', output='out.css').build()
     assert doctest_match("""/* ... */\nh1 {\n  font-family: "Verdana";\n  color: white;\n}\n""", self.get('out.css'))
Beispiel #17
0
 def test(self):
     self.mkbundle('foo.scss', filters='pyscss', output='out.css').build()
     assert doctest_match(
         '/* ... */\nh1 {\n  color: #ff0000;\n}\na {\n  color: #ff8000;\n}\n\n',
         self.get('out.css'),)
Beispiel #18
0
 def test(self):
     self.mkbundle("foo.scss", filters="pyscss", output="out.css").build()
     assert doctest_match(
         "/* ... */\nh1 {\n  color: #ff0000;\n}\na {\n  color: #ff8000;\n}\n\n", self.get("out.css")
     )
Beispiel #19
0
 def test_compass_with_scss(self):
     # [bug] test compass with scss files
     self.mkbundle('foo.scss', filters='compass', output='out.css').build()
     assert doctest_match("""/* ... */\nh1 {\n  font-family: "Verdana";\n  color: #FFFFFF;\n}\n""", self.get('out.css'))
Beispiel #20
0
 def test_compass_with_imports(self):
     self.mkbundle('import.scss', filters='compass', output='out.css').build()
     assert doctest_match("""/* ... */\nh1 {\n  font-family: "Verdana";\n  color: #FFFFFF;\n}\n""", self.get('out.css'))
Beispiel #21
0
 def test(self):
     self.mkbundle('foo.scss', filters='pyscss', output='out.css').build()
     assert doctest_match(
         '/* ... */\nh1 {\n  color: #ff0000;\n}\na {\n  color: #ff8000;\n}\n\n',
         self.get('out.css'),)
Beispiel #22
0
 def test_compass(self):
     self.mkbundle("foo.sass", filters="compass", output="out.css").build()
     assert doctest_match(
         """/* ... */\nh1 {\n  font-family: "Verdana";\n  color: white;\n}\n""", self.get("out.css")
     )