diff options
| author | 2016-11-15 14:18:53 -0300 | |
|---|---|---|
| committer | 2016-11-15 14:18:53 -0300 | |
| commit | 1ad5102b7ddd181bb9c632b124d3ea4c7db28be6 (patch) | |
| tree | 73dda18465d0f4b8eb52d4482282a387c9f67c95 /tests/test_utils.py | |
| parent | b67294f76809a681ff73f209ed691a3e3f00563d (diff) | |
| parent | ffb671c61a24a9086343b54bad080e145ff33fc5 (diff) | |
Merge tag 'upstream/7.8.1'
Upstream version 7.8.1
# gpg: Firmado el mar 15 nov 2016 14:18:48 ART
# gpg: usando RSA clave A6C7B88B9583046A11C5403E0B00FB6CEBE2D002
# gpg: Firma correcta de "Ulises Vitulli <dererk@debian.org>" [absoluta]
# gpg: alias "Dererk <dererk@torproject.org>" [absoluta]
# gpg: alias "Ulises Vitulli <uvitulli@fi.uba.ar>" [absoluta]
# gpg: alias "Ulises Vitulli <dererk@satellogic.com>" [absoluta]
Diffstat (limited to 'tests/test_utils.py')
| -rw-r--r-- | tests/test_utils.py | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py index 9507de2..225ff13 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,10 +1,5 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals - -import os -import sys - - import unittest import mock import lxml.html @@ -13,7 +8,7 @@ from nikola.utils import demote_headers, TranslatableSetting class dummy(object): - pass + default_lang = 'en' class GetMetaTest(unittest.TestCase): @@ -323,13 +318,14 @@ def test_get_metadata_from_file(): from nikola.post import _get_metadata_from_file g = _get_metadata_from_file assert list(g([]).values()) == [] - assert str(g(["======","FooBar","======"])["title"]) == 'FooBar' - assert str(g(["FooBar","======"])["title"]) == 'FooBar' + assert str(g(["======", "FooBar", "======"])["title"]) == 'FooBar' + assert str(g(["FooBar", "======"])["title"]) == 'FooBar' assert str(g(["#FooBar"])["title"]) == 'FooBar' assert str(g([".. title: FooBar"])["title"]) == 'FooBar' - assert 'title' not in g(["","",".. title: FooBar"]) - assert 'title' in g(["",".. title: FooBar"]) - assert 'title' in g([".. foo: bar","","FooBar", "------"]) + assert 'title' not in g(["", "", ".. title: FooBar"]) + assert 'title' in g(["", ".. title: FooBar"]) + assert 'title' in g([".. foo: bar", "", "FooBar", "------"]) + if __name__ == '__main__': unittest.main() |
