Browse Source

Sort resources by name before combining.

main
Vincent Bernat 13 years ago
parent
commit
cc814a3940
2 changed files with 9 additions and 5 deletions
  1. +1
    -1
      hyde/ext/plugins/combine.py
  2. +8
    -4
      hyde/tests/ext/test_combine.py

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

@@ -55,7 +55,7 @@ class CombinePlugin(Plugin):
self.logger.debug("No resources to combine for [%s]" % resource)
return []

return resources
return sorted(resources, key=lambda r: r.name)

def begin_site(self):
"""


+ 8
- 4
hyde/tests/ext/test_combine.py View File

@@ -50,8 +50,10 @@ combine:
---

Last line""")
assert len(text.split("\n")) == 4
assert text.split("\n")[-1] == "Last line"
assert text == """var a = 1 + 2;
var b = a + 3;
var c = a + 5;
Last line"""
return

def test_combine_bottom(self):
@@ -64,8 +66,10 @@ combine:

First line
""")
assert len(text.split("\n")) == 4
assert text.split("\n")[0] == "First line"
assert text == """First line
var a = 1 + 2;
var b = a + 3;
var c = a + 5;"""
return

def test_combine_remove(self):


Loading…
Cancel
Save