diff options
| author | Michael Merickel <michael@merickel.org> | 2018-10-14 23:16:48 -0500 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2018-10-14 23:46:11 -0500 |
| commit | dd3cc81f75dcb5ff96e0751653071722a15f46c2 (patch) | |
| tree | 7cfd6140211a21dedd2ddfeb4aa77b7ff4339fa9 /tests/test_scripts | |
| parent | eadaee315eb142d1537d617da58343e3d7f1df0a (diff) | |
| download | pyramid-dd3cc81f75dcb5ff96e0751653071722a15f46c2.tar.gz pyramid-dd3cc81f75dcb5ff96e0751653071722a15f46c2.tar.bz2 pyramid-dd3cc81f75dcb5ff96e0751653071722a15f46c2.zip | |
fix the tests to import from the tests package instead of pyramid.tests
Diffstat (limited to 'tests/test_scripts')
| -rw-r--r-- | tests/test_scripts/test_prequest.py | 2 | ||||
| -rw-r--r-- | tests/test_scripts/test_proutes.py | 28 | ||||
| -rw-r--r-- | tests/test_scripts/test_pserve.py | 4 | ||||
| -rw-r--r-- | tests/test_scripts/test_pshell.py | 2 | ||||
| -rw-r--r-- | tests/test_scripts/test_ptweens.py | 2 | ||||
| -rw-r--r-- | tests/test_scripts/test_pviews.py | 24 |
6 files changed, 31 insertions, 31 deletions
diff --git a/tests/test_scripts/test_prequest.py b/tests/test_scripts/test_prequest.py index 75d5cc198..f7e656995 100644 --- a/tests/test_scripts/test_prequest.py +++ b/tests/test_scripts/test_prequest.py @@ -1,5 +1,5 @@ import unittest -from pyramid.tests.test_scripts import dummy +from . import dummy class TestPRequestCommand(unittest.TestCase): def _getTargetClass(self): diff --git a/tests/test_scripts/test_proutes.py b/tests/test_scripts/test_proutes.py index fab5e163e..0de331c94 100644 --- a/tests/test_scripts/test_proutes.py +++ b/tests/test_scripts/test_proutes.py @@ -1,6 +1,6 @@ import os import unittest -from pyramid.tests.test_scripts import dummy +from . import dummy class DummyIntrospector(object): @@ -160,7 +160,7 @@ class TestPRoutesCommand(unittest.TestCase): compare_to = L[-1].split()[:3] self.assertEqual( compare_to, - ['a', '/a', 'pyramid.tests.test_scripts.test_proutes.view'] + ['a', '/a', 'tests.test_scripts.test_proutes.view'] ) def test_one_route_with_long_name_one_view_registered(self): @@ -202,7 +202,7 @@ class TestPRoutesCommand(unittest.TestCase): compare_to, ['very_long_name_123', '/and_very_long_pattern_as_well', - 'pyramid.tests.test_scripts.test_proutes.view'] + 'tests.test_scripts.test_proutes.view'] ) def test_class_view(self): @@ -228,7 +228,7 @@ class TestPRoutesCommand(unittest.TestCase): compare_to = L[-1].split() expected = [ 'foo', '/a/b', - 'pyramid.tests.test_scripts.dummy.DummyView.view', 'POST' + 'tests.test_scripts.dummy.DummyView.view', 'POST' ] self.assertEqual(compare_to, expected) @@ -296,8 +296,8 @@ class TestPRoutesCommand(unittest.TestCase): self.assertEqual(result, 0) self.assertEqual(len(L), 3) compare_to = L[-1].split()[:3] - view_module = 'pyramid.tests.test_scripts.dummy' - view_str = '<pyramid.tests.test_scripts.dummy.DummyMultiView' + view_module = 'tests.test_scripts.dummy' + view_str = '<tests.test_scripts.dummy.DummyMultiView' final = '%s.%s' % (view_module, view_str) self.assertEqual( @@ -337,7 +337,7 @@ class TestPRoutesCommand(unittest.TestCase): compare_to = L[-1].split() expected = [ 'foo', '/a/b', - 'pyramid.tests.test_scripts.test_proutes.view1', 'POST' + 'tests.test_scripts.test_proutes.view1', 'POST' ] self.assertEqual(compare_to, expected) @@ -364,7 +364,7 @@ class TestPRoutesCommand(unittest.TestCase): compare_to = L[-1].split() expected = [ 'foo', '/a/b', - 'pyramid.tests.test_scripts.test_proutes.view1', 'POST' + 'tests.test_scripts.test_proutes.view1', 'POST' ] self.assertEqual(compare_to, expected) @@ -392,7 +392,7 @@ class TestPRoutesCommand(unittest.TestCase): compare_to = L[-1].split() expected = [ 'foo', '/a/b', - 'pyramid.tests.test_scripts.test_proutes.view1', 'POST' + 'tests.test_scripts.test_proutes.view1', 'POST' ] self.assertEqual(compare_to, expected) @@ -420,7 +420,7 @@ class TestPRoutesCommand(unittest.TestCase): compare_to = L[-1].split() expected = [ 'foo', '/a/b', - 'pyramid.tests.test_scripts.test_proutes.view1', + 'tests.test_scripts.test_proutes.view1', '<route', 'mismatch>' ] self.assertEqual(compare_to, expected) @@ -446,7 +446,7 @@ class TestPRoutesCommand(unittest.TestCase): expected = [ ['__static/', '/static/*subpath', - 'pyramid.tests.test_scripts:static/', '*'], + 'tests.test_scripts:static/', '*'], ['__static2/', '/static2/*subpath', path2 + os.sep, '*'], ['__pyramid_scaffold/', '/pyramid_scaffold/*subpath', 'pyramid:scaffolds/starter/+package+/static/', '*'], @@ -531,7 +531,7 @@ class TestPRoutesCommand(unittest.TestCase): compare_to = L[-1].split() expected = [ 'foo', '/a/b', - 'pyramid.tests.test_scripts.test_proutes.view1', + 'tests.test_scripts.test_proutes.view1', 'GET' ] self.assertEqual(compare_to, expected) @@ -561,7 +561,7 @@ class TestPRoutesCommand(unittest.TestCase): compare_to = L[-1].split() expected = [ 'foo', '/a/b', - 'pyramid.tests.test_scripts.test_proutes.view1', + 'tests.test_scripts.test_proutes.view1', '!POST,*' ] self.assertEqual(compare_to, expected) @@ -602,7 +602,7 @@ class TestPRoutesCommand(unittest.TestCase): compare_to = L[-1].split() expected = [ 'foo', '/a/b', - 'pyramid.tests.test_scripts.test_proutes.view1', + 'tests.test_scripts.test_proutes.view1', '!POST,*' ] self.assertEqual(compare_to, expected) diff --git a/tests/test_scripts/test_pserve.py b/tests/test_scripts/test_pserve.py index 485cf38cb..0c46b5348 100644 --- a/tests/test_scripts/test_pserve.py +++ b/tests/test_scripts/test_pserve.py @@ -1,6 +1,6 @@ import os import unittest -from pyramid.tests.test_scripts import dummy +from . import dummy here = os.path.abspath(os.path.dirname(__file__)) @@ -55,7 +55,7 @@ class TestPServeCommand(unittest.TestCase): inst = self._makeOne('development.ini') loader = self.loader('/base/path.ini') loader.settings = {'pserve': { - 'watch_files': 'foo\n/baz\npyramid.tests.test_scripts:*.py', + 'watch_files': 'foo\n/baz\ntests.test_scripts:*.py', }} inst.pserve_file_config(loader, global_conf={'a': '1'}) self.assertEqual(loader.calls[0]['defaults'], { diff --git a/tests/test_scripts/test_pshell.py b/tests/test_scripts/test_pshell.py index df664bea9..291714340 100644 --- a/tests/test_scripts/test_pshell.py +++ b/tests/test_scripts/test_pshell.py @@ -1,6 +1,6 @@ import os import unittest -from pyramid.tests.test_scripts import dummy +from . import dummy class TestPShellCommand(unittest.TestCase): diff --git a/tests/test_scripts/test_ptweens.py b/tests/test_scripts/test_ptweens.py index 6907b858d..4ad015249 100644 --- a/tests/test_scripts/test_ptweens.py +++ b/tests/test_scripts/test_ptweens.py @@ -1,5 +1,5 @@ import unittest -from pyramid.tests.test_scripts import dummy +from . import dummy class TestPTweensCommand(unittest.TestCase): def _getTargetClass(self): diff --git a/tests/test_scripts/test_pviews.py b/tests/test_scripts/test_pviews.py index 6ec9defbd..999028f28 100644 --- a/tests/test_scripts/test_pviews.py +++ b/tests/test_scripts/test_pviews.py @@ -1,5 +1,5 @@ import unittest -from pyramid.tests.test_scripts import dummy +from . import dummy class TestPViewsCommand(unittest.TestCase): def _getTargetClass(self): @@ -280,7 +280,7 @@ class TestPViewsCommand(unittest.TestCase): self.assertEqual(L[3], ' context: context') self.assertEqual(L[4], ' view name: a') self.assertEqual(L[8], - ' pyramid.tests.test_scripts.dummy.DummyView') + ' tests.test_scripts.dummy.DummyView') def test_views_command_single_view_function_traversal(self): from pyramid.registry import Registry @@ -299,7 +299,7 @@ class TestPViewsCommand(unittest.TestCase): self.assertEqual(L[3], ' context: context') self.assertEqual(L[4], ' view name: a') self.assertEqual(L[8], - ' pyramid.tests.test_scripts.test_pviews.view') + ' tests.test_scripts.test_pviews.view') def test_views_command_single_view_traversal_with_permission(self): from pyramid.registry import Registry @@ -318,7 +318,7 @@ class TestPViewsCommand(unittest.TestCase): self.assertEqual(L[3], ' context: context') self.assertEqual(L[4], ' view name: a') self.assertEqual(L[8], - ' pyramid.tests.test_scripts.dummy.DummyView') + ' tests.test_scripts.dummy.DummyView') self.assertEqual(L[9], ' required permission = test') def test_views_command_single_view_traversal_with_predicates(self): @@ -340,7 +340,7 @@ class TestPViewsCommand(unittest.TestCase): self.assertEqual(L[3], ' context: context') self.assertEqual(L[4], ' view name: a') self.assertEqual(L[8], - ' pyramid.tests.test_scripts.dummy.DummyView') + ' tests.test_scripts.dummy.DummyView') self.assertEqual(L[9], ' view predicates (predicate = x)') def test_views_command_single_view_route(self): @@ -366,7 +366,7 @@ class TestPViewsCommand(unittest.TestCase): self.assertEqual(L[10], ' route path: /a') self.assertEqual(L[11], ' subpath: ') self.assertEqual(L[15], - ' pyramid.tests.test_scripts.dummy.DummyView') + ' tests.test_scripts.dummy.DummyView') def test_views_command_multi_view_nested(self): from pyramid.registry import Registry @@ -390,9 +390,9 @@ class TestPViewsCommand(unittest.TestCase): self.assertEqual(L[3], ' context: context') self.assertEqual(L[4], ' view name: a') self.assertEqual(L[8], - ' pyramid.tests.test_scripts.dummy.DummyMultiView') + ' tests.test_scripts.dummy.DummyMultiView') self.assertEqual(L[12], - ' pyramid.tests.test_scripts.dummy.view1.call') + ' tests.test_scripts.dummy.view1.call') def test_views_command_single_view_route_with_route_predicates(self): from pyramid.registry import Registry @@ -420,7 +420,7 @@ class TestPViewsCommand(unittest.TestCase): self.assertEqual(L[11], ' subpath: ') self.assertEqual(L[12], ' route predicates (predicate = x)') self.assertEqual(L[16], - ' pyramid.tests.test_scripts.dummy.DummyView') + ' tests.test_scripts.dummy.DummyView') def test_views_command_multiview(self): from pyramid.registry import Registry @@ -441,7 +441,7 @@ class TestPViewsCommand(unittest.TestCase): self.assertEqual(L[3], ' context: context') self.assertEqual(L[4], ' view name: a') self.assertEqual(L[8], - ' pyramid.tests.test_scripts.dummy.view.call') + ' tests.test_scripts.dummy.view.call') def test_views_command_multiview_with_permission(self): from pyramid.registry import Registry @@ -463,7 +463,7 @@ class TestPViewsCommand(unittest.TestCase): self.assertEqual(L[3], ' context: context') self.assertEqual(L[4], ' view name: a') self.assertEqual(L[8], - ' pyramid.tests.test_scripts.dummy.view.call') + ' tests.test_scripts.dummy.view.call') self.assertEqual(L[9], ' required permission = test') def test_views_command_multiview_with_predicates(self): @@ -488,7 +488,7 @@ class TestPViewsCommand(unittest.TestCase): self.assertEqual(L[3], ' context: context') self.assertEqual(L[4], ' view name: a') self.assertEqual(L[8], - ' pyramid.tests.test_scripts.dummy.view.call') + ' tests.test_scripts.dummy.view.call') self.assertEqual(L[9], ' view predicates (predicate = x)') class Test_main(unittest.TestCase): |
