mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Unit tests for webassets
remove the unit tests for the lesscss generator (TestLessCSSGenerator class) and replace it with tests for webassets: - add a sample scss file - run pelican with example files - compare the generated css file with a reference one - look in the html code for the correct link tag
This commit is contained in:
parent
5f51cffe08
commit
b66a37ccb1
4 changed files with 68 additions and 44 deletions
1
tests/themes/assets/static/css/style.min.css
vendored
Normal file
1
tests/themes/assets/static/css/style.min.css
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
body{font:14px/1.5 "Droid Sans",sans-serif;background-color:#e4e4e4;color:#242424}a{color:red}a:hover{color:orange}
|
||||
19
tests/themes/assets/static/css/style.scss
Normal file
19
tests/themes/assets/static/css/style.scss
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/* -*- scss-compile-at-save: nil -*- */
|
||||
|
||||
$baseFontFamily : "Droid Sans", sans-serif;
|
||||
$textColor : #242424;
|
||||
$bodyBackground : #e4e4e4;
|
||||
|
||||
body {
|
||||
font: 14px/1.5 $baseFontFamily;
|
||||
background-color: $bodyBackground;
|
||||
color: $textColor;
|
||||
}
|
||||
|
||||
a {
|
||||
color: red;
|
||||
|
||||
&:hover {
|
||||
color: orange;
|
||||
}
|
||||
}
|
||||
7
tests/themes/assets/templates/base.html
Normal file
7
tests/themes/assets/templates/base.html
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{% extends "!simple/base.html" %}
|
||||
|
||||
{% block head %}
|
||||
{% assets filters="scss,cssmin", output="gen/style.%(version)s.min.css", "css/style.scss" %}
|
||||
<link rel="stylesheet" href="{{ ASSET_URL }}">
|
||||
{% endassets %}
|
||||
{% endblock %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue