Skip to content

Commit

Permalink
Hoist tests out of the core package
Browse files Browse the repository at this point in the history
Tests are not part of the core logic of Hyde, and they should not be
packaged as such.
  • Loading branch information
jonafato committed Nov 8, 2015
1 parent b73261c commit 0a9f3a7
Show file tree
Hide file tree
Showing 140 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Expand Up @@ -8,5 +8,5 @@ include requirements.txt
include dev-req.txt
include dev-only.txt
recursive-include hyde *.py
recursive-include hyde/tests *.py
recursive-include tests *.py
recursive-include hyde/layouts *.*
2 changes: 1 addition & 1 deletion hyde/tests/README.rst → tests/README.rst
Expand Up @@ -42,4 +42,4 @@ Run the tests
=============

::
nosetests hyde/tests
nosetests tests
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion hyde/tests/ext/test_grouper.py → tests/ext/test_grouper.py
Expand Up @@ -10,9 +10,10 @@
from hyde.model import Config, Expando

from fswrap import File
from hyde.tests.util import assert_html_equals
import yaml

from ..util import assert_html_equals

TEST_SITE = File(__file__).parent.parent.child_folder('_test')


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion hyde/tests/ext/test_sass.py → tests/ext/test_sass.py
Expand Up @@ -6,10 +6,11 @@
"""
from hyde.generator import Generator
from hyde.site import Site
from hyde.tests.util import assert_no_diff

from fswrap import File, Folder

from ..util import assert_no_diff

SCSS_SOURCE = File(__file__).parent.child_folder('scss')
TEST_SITE = File(__file__).parent.parent.child_folder('_test')

Expand Down
3 changes: 2 additions & 1 deletion hyde/tests/ext/test_scss.py → tests/ext/test_scss.py
Expand Up @@ -6,10 +6,11 @@
"""
from hyde.generator import Generator
from hyde.site import Site
from hyde.tests.util import assert_no_diff

from fswrap import File, Folder

from ..util import assert_no_diff

SCSS_SOURCE = File(__file__).parent.child_folder('scss')
TEST_SITE = File(__file__).parent.parent.child_folder('_test')

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 3 additions & 1 deletion hyde/tests/ext/test_uglify.py → tests/ext/test_uglify.py
Expand Up @@ -4,12 +4,14 @@
`$ pip install nose`
`$ nosetests`
"""

from hyde.model import Expando
from hyde.generator import Generator
from hyde.site import Site

from fswrap import File, Folder
from hyde.tests.util import assert_no_diff

from ..util import assert_no_diff

UGLIFY_SOURCE = File(__file__).parent.child_folder('uglify')
TEST_SITE = File(__file__).parent.parent.child_folder('_test')
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions hyde/tests/test_plugin.py → tests/test_plugin.py
Expand Up @@ -68,7 +68,7 @@ def teardown_class(cls):

def setUp(self):
self.site = Site(TEST_SITE)
self.site.config.plugins = ['hyde.tests.test_plugin.PluginLoaderStub']
self.site.config.plugins = ['tests.test_plugin.PluginLoaderStub']

def test_can_load_plugin_modules(self):
assert not len(self.site.plugins)
Expand Down Expand Up @@ -354,8 +354,8 @@ def test_generator_template_begin_binary_resource_called_4_sngl_res(self):

def test_plugin_chaining(self):
self.site.config.plugins = [
'hyde.tests.test_plugin.ConstantReturnPlugin',
'hyde.tests.test_plugin.NoReturnPlugin'
'tests.test_plugin.ConstantReturnPlugin',
'tests.test_plugin.NoReturnPlugin'
]
path = self.site.content.source_folder.child('about.html')
gen = Generator(self.site)
Expand All @@ -372,8 +372,8 @@ def empty_return(self, resource, text=''):
with patch.object(NoReturnPlugin, 'begin_text_resource',
new=Mock(wraps=empty_return)) as mock2:
self.site.config.plugins = [
'hyde.tests.test_plugin.ConstantReturnPlugin',
'hyde.tests.test_plugin.NoReturnPlugin'
'tests.test_plugin.ConstantReturnPlugin',
'tests.test_plugin.NoReturnPlugin'
]
self.site.config.constantreturn = Expando(
dict(include_file_pattern="*.css"))
Expand All @@ -400,8 +400,8 @@ def empty_return(*args, **kwargs):
with patch.object(NoReturnPlugin, 'begin_text_resource',
new=Mock(wraps=empty_return)) as mock2:
self.site.config.plugins = [
'hyde.tests.test_plugin.ConstantReturnPlugin',
'hyde.tests.test_plugin.NoReturnPlugin'
'tests.test_plugin.ConstantReturnPlugin',
'tests.test_plugin.NoReturnPlugin'
]
self.site.config.constantreturn = Expando(
dict(include_paths="media"))
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 0a9f3a7

Please sign in to comment.