Browse Source

updated unittests

main
Jordi Llonch 9 years ago
parent
commit
d0c67f92c0
8 changed files with 37 additions and 37 deletions
  1. +1
    -1
      hyde/ext/plugins/css.py
  2. +18
    -14
      hyde/tests/ext/less/expected-site.css
  3. +6
    -7
      hyde/tests/ext/scss/expected-site.css
  4. +1
    -1
      hyde/tests/ext/scss/site.scss
  5. +1
    -4
      hyde/tests/ext/stylus/expected-site-compressed.css
  6. +2
    -2
      hyde/tests/ext/test_stylus.py
  7. +4
    -4
      hyde/tests/ext/uglify/expected-jquery-nc.js
  8. +4
    -4
      hyde/tests/ext/uglify/expected-jquery.js

+ 1
- 1
hyde/ext/plugins/css.py View File

@@ -218,7 +218,6 @@ class StylusPlugin(CLTransformer):
return return
stylus = self.app stylus = self.app
source = File.make_temp(text.strip()) source = File.make_temp(text.strip())
target = source
supported = [("compress", "c"), ("include", "I")] supported = [("compress", "c"), ("include", "I")]


args = [unicode(stylus)] args = [unicode(stylus)]
@@ -231,6 +230,7 @@ class StylusPlugin(CLTransformer):
"Cannot process %s. Error occurred when " "Cannot process %s. Error occurred when "
"processing [%s]" % (stylus.name, resource.source_file), "processing [%s]" % (stylus.name, resource.source_file),
sys.exc_info()) sys.exc_info())
target = File(source.path + '.css')
return target.read_all() return target.read_all()






+ 18
- 14
hyde/tests/ext/less/expected-site.css View File

@@ -1,18 +1,22 @@
* {
border: 0;
padding: 0;
margin: 0;
}
#header {
color: #333333;
border-left: 1px;
border-right: 2px;
.rounded (@radius: 5px){
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
border-radius: @radius;
}@the-border: 1px;
@base-color: #111;* {
border: 0;
padding: 0;
margin: 0;
}#header {
color: @base-color * 3;
border-left: @the-border;
border-right: @the-border * 2;
} }

#footer { #footer {
color: #333333;
color: (@base-color + #111) * 1.5;
} }

#content { #content {
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
}
.rounded(10px);
}

+ 6
- 7
hyde/tests/ext/scss/expected-site.css View File

@@ -1,16 +1,15 @@
* {
border: 0;
padding: 0;
margin: 0;
}
@import "inc/reset.css";

#header { #header {
color: #333333;
color: #333;
border-left: 1px; border-left: 1px;
border-right: 2px; border-right: 2px;
} }

#footer { #footer {
color: #333333;
color: #333;
} }

#content { #content {
-webkit-border-radius: 10px; -webkit-border-radius: 10px;
-moz-border-radius: 10px; -moz-border-radius: 10px;


+ 1
- 1
hyde/tests/ext/scss/site.scss View File

@@ -1,4 +1,4 @@
@option compress: no;
@option style: expanded;


@import "inc/mixin"; @import "inc/mixin";
@import "inc/vars"; @import "inc/vars";


+ 1
- 4
hyde/tests/ext/stylus/expected-site-compressed.css View File

@@ -1,4 +1 @@
*{border:0;padding:0;margin:0}
#header{color:#333;border-left:1px;border-right:2px}
#footer{color:#333}
#content{-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px}
*{border:0;padding:0;margin:0}#header{color:#333;border-left:1px;border-right:2px}#footer{color:#333}#content{-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px}

+ 2
- 2
hyde/tests/ext/test_stylus.py View File

@@ -29,7 +29,7 @@ class TestStylus(object):
def test_can_execute_stylus(self): def test_can_execute_stylus(self):
s = Site(TEST_SITE) s = Site(TEST_SITE)
s.config.plugins = ['hyde.ext.plugins.css.StylusPlugin'] s.config.plugins = ['hyde.ext.plugins.css.StylusPlugin']
paths = ['/usr/local/share/npm/bin/stylus']
paths = ['/usr/local/bin/stylus', '/usr/local/share/npm/bin/stylus']
for path in paths: for path in paths:
if File(path).exists: if File(path).exists:
s.config.stylus = Expando(dict(app=path)) s.config.stylus = Expando(dict(app=path))
@@ -47,7 +47,7 @@ class TestStylus(object):
s = Site(TEST_SITE) s = Site(TEST_SITE)
s.config.mode = "production" s.config.mode = "production"
s.config.plugins = ['hyde.ext.plugins.css.StylusPlugin'] s.config.plugins = ['hyde.ext.plugins.css.StylusPlugin']
paths = ['/usr/local/share/npm/bin/stylus']
paths = ['/usr/local/bin/stylus', '/usr/local/share/npm/bin/stylus']
for path in paths: for path in paths:
if File(path).exists: if File(path).exists:
s.config.stylus = Expando(dict(app=path)) s.config.stylus = Expando(dict(app=path))


+ 4
- 4
hyde/tests/ext/uglify/expected-jquery-nc.js
File diff suppressed because it is too large
View File


+ 4
- 4
hyde/tests/ext/uglify/expected-jquery.js
File diff suppressed because it is too large
View File


Loading…
Cancel
Save