summaryrefslogtreecommitdiff
path: root/tests/test_scaffolds
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2018-10-14 21:11:41 -0500
committerMichael Merickel <michael@merickel.org>2018-10-14 21:11:41 -0500
commit3670c2cdb732d378ba6d38e72e7cd875ff726aa9 (patch)
tree5213452a778c992d42602efe7d3b3655a349abd5 /tests/test_scaffolds
parent2b024920847481592b1a13d4006d2a9fa8881d72 (diff)
downloadpyramid-3670c2cdb732d378ba6d38e72e7cd875ff726aa9.tar.gz
pyramid-3670c2cdb732d378ba6d38e72e7cd875ff726aa9.tar.bz2
pyramid-3670c2cdb732d378ba6d38e72e7cd875ff726aa9.zip
move tests out of the package
Diffstat (limited to 'tests/test_scaffolds')
-rw-r--r--tests/test_scaffolds/__init__.py1
-rw-r--r--tests/test_scaffolds/fixture_scaffold/+package+/.badfile0
-rw-r--r--tests/test_scaffolds/fixture_scaffold/+package+/__init__.py_tmpl12
-rw-r--r--tests/test_scaffolds/fixture_scaffold/+package+/resources.py3
-rw-r--r--tests/test_scaffolds/fixture_scaffold/+package+/static/favicon.icobin0 -> 1406 bytes
-rw-r--r--tests/test_scaffolds/fixture_scaffold/+package+/static/footerbg.pngbin0 -> 333 bytes
-rw-r--r--tests/test_scaffolds/fixture_scaffold/+package+/static/headerbg.pngbin0 -> 203 bytes
-rw-r--r--tests/test_scaffolds/fixture_scaffold/+package+/static/ie6.css8
-rw-r--r--tests/test_scaffolds/fixture_scaffold/+package+/static/middlebg.pngbin0 -> 2797 bytes
-rw-r--r--tests/test_scaffolds/fixture_scaffold/+package+/static/pylons.css65
-rw-r--r--tests/test_scaffolds/fixture_scaffold/+package+/static/pyramid-small.pngbin0 -> 7044 bytes
-rw-r--r--tests/test_scaffolds/fixture_scaffold/+package+/static/pyramid.pngbin0 -> 33055 bytes
-rw-r--r--tests/test_scaffolds/fixture_scaffold/+package+/static/transparent.gifbin0 -> 49 bytes
-rw-r--r--tests/test_scaffolds/fixture_scaffold/+package+/templates/mytemplate.pt_tmpl76
-rw-r--r--tests/test_scaffolds/fixture_scaffold/+package+/test_no_content.py_tmpl0
-rw-r--r--tests/test_scaffolds/fixture_scaffold/+package+/tests.py_tmpl16
-rw-r--r--tests/test_scaffolds/fixture_scaffold/+package+/views.py_tmpl2
-rw-r--r--tests/test_scaffolds/fixture_scaffold/CHANGES.txt_tmpl4
-rw-r--r--tests/test_scaffolds/fixture_scaffold/MANIFEST.in_tmpl2
-rw-r--r--tests/test_scaffolds/fixture_scaffold/README.txt_tmpl1
-rw-r--r--tests/test_scaffolds/fixture_scaffold/development.ini_tmpl45
-rw-r--r--tests/test_scaffolds/fixture_scaffold/production.ini_tmpl44
-rw-r--r--tests/test_scaffolds/fixture_scaffold/setup.py_tmpl38
-rw-r--r--tests/test_scaffolds/test_copydir.py455
-rw-r--r--tests/test_scaffolds/test_init.py21
-rw-r--r--tests/test_scaffolds/test_template.py155
26 files changed, 948 insertions, 0 deletions
diff --git a/tests/test_scaffolds/__init__.py b/tests/test_scaffolds/__init__.py
new file mode 100644
index 000000000..5bb534f79
--- /dev/null
+++ b/tests/test_scaffolds/__init__.py
@@ -0,0 +1 @@
+# package
diff --git a/tests/test_scaffolds/fixture_scaffold/+package+/.badfile b/tests/test_scaffolds/fixture_scaffold/+package+/.badfile
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/test_scaffolds/fixture_scaffold/+package+/.badfile
diff --git a/tests/test_scaffolds/fixture_scaffold/+package+/__init__.py_tmpl b/tests/test_scaffolds/fixture_scaffold/+package+/__init__.py_tmpl
new file mode 100644
index 000000000..d763b2435
--- /dev/null
+++ b/tests/test_scaffolds/fixture_scaffold/+package+/__init__.py_tmpl
@@ -0,0 +1,12 @@
+from pyramid.config import Configurator
+from {{package}}.resources import Root
+
+def main(global_config, **settings):
+ """ This function returns a Pyramid WSGI application.
+ """
+ config = Configurator(root_factory=Root, settings=settings)
+ config.add_view('{{package}}.views.my_view',
+ context='{{package}}:resources.Root',
+ renderer='{{package}}:templates/mytemplate.pt')
+ config.add_static_view('static', '{{package}}:static', cache_max_age=3600)
+ return config.make_wsgi_app()
diff --git a/tests/test_scaffolds/fixture_scaffold/+package+/resources.py b/tests/test_scaffolds/fixture_scaffold/+package+/resources.py
new file mode 100644
index 000000000..3d811895c
--- /dev/null
+++ b/tests/test_scaffolds/fixture_scaffold/+package+/resources.py
@@ -0,0 +1,3 @@
+class Root(object):
+ def __init__(self, request):
+ self.request = request
diff --git a/tests/test_scaffolds/fixture_scaffold/+package+/static/favicon.ico b/tests/test_scaffolds/fixture_scaffold/+package+/static/favicon.ico
new file mode 100644
index 000000000..71f837c9e
--- /dev/null
+++ b/tests/test_scaffolds/fixture_scaffold/+package+/static/favicon.ico
Binary files differ
diff --git a/tests/test_scaffolds/fixture_scaffold/+package+/static/footerbg.png b/tests/test_scaffolds/fixture_scaffold/+package+/static/footerbg.png
new file mode 100644
index 000000000..1fbc873da
--- /dev/null
+++ b/tests/test_scaffolds/fixture_scaffold/+package+/static/footerbg.png
Binary files differ
diff --git a/tests/test_scaffolds/fixture_scaffold/+package+/static/headerbg.png b/tests/test_scaffolds/fixture_scaffold/+package+/static/headerbg.png
new file mode 100644
index 000000000..0596f2020
--- /dev/null
+++ b/tests/test_scaffolds/fixture_scaffold/+package+/static/headerbg.png
Binary files differ
diff --git a/tests/test_scaffolds/fixture_scaffold/+package+/static/ie6.css b/tests/test_scaffolds/fixture_scaffold/+package+/static/ie6.css
new file mode 100644
index 000000000..b7c8493d8
--- /dev/null
+++ b/tests/test_scaffolds/fixture_scaffold/+package+/static/ie6.css
@@ -0,0 +1,8 @@
+* html img,
+* html .png{position:relative;behavior:expression((this.runtimeStyle.behavior="none")&&(this.pngSet?this.pngSet=true:(this.nodeName == "IMG" && this.src.toLowerCase().indexOf('.png')>-1?(this.runtimeStyle.backgroundImage = "none",
+this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.src + "',sizingMethod='image')",
+this.src = "static/transparent.gif"):(this.origBg = this.origBg? this.origBg :this.currentStyle.backgroundImage.toString().replace('url("','').replace('")',''),
+this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.origBg + "',sizingMethod='crop')",
+this.runtimeStyle.backgroundImage = "none")),this.pngSet=true)
+);}
+#wrap{display:table;height:100%}
diff --git a/tests/test_scaffolds/fixture_scaffold/+package+/static/middlebg.png b/tests/test_scaffolds/fixture_scaffold/+package+/static/middlebg.png
new file mode 100644
index 000000000..2369cfb7d
--- /dev/null
+++ b/tests/test_scaffolds/fixture_scaffold/+package+/static/middlebg.png
Binary files differ
diff --git a/tests/test_scaffolds/fixture_scaffold/+package+/static/pylons.css b/tests/test_scaffolds/fixture_scaffold/+package+/static/pylons.css
new file mode 100644
index 000000000..c54499ddd
--- /dev/null
+++ b/tests/test_scaffolds/fixture_scaffold/+package+/static/pylons.css
@@ -0,0 +1,65 @@
+html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;/* 16px */
+vertical-align:baseline;background:transparent;}
+body{line-height:1;}
+ol,ul{list-style:none;}
+blockquote,q{quotes:none;}
+blockquote:before,blockquote:after,q:before,q:after{content:'';content:none;}
+:focus{outline:0;}
+ins{text-decoration:none;}
+del{text-decoration:line-through;}
+table{border-collapse:collapse;border-spacing:0;}
+sub{vertical-align:sub;font-size:smaller;line-height:normal;}
+sup{vertical-align:super;font-size:smaller;line-height:normal;}
+ul,menu,dir{display:block;list-style-type:disc;margin:1em 0;padding-left:40px;}
+ol{display:block;list-style-type:decimal-leading-zero;margin:1em 0;padding-left:40px;}
+li{display:list-item;}
+ul ul,ul ol,ul dir,ul menu,ul dl,ol ul,ol ol,ol dir,ol menu,ol dl,dir ul,dir ol,dir dir,dir menu,dir dl,menu ul,menu ol,menu dir,menu menu,menu dl,dl ul,dl ol,dl dir,dl menu,dl dl{margin-top:0;margin-bottom:0;}
+ol ul,ul ul,menu ul,dir ul,ol menu,ul menu,menu menu,dir menu,ol dir,ul dir,menu dir,dir dir{list-style-type:circle;}
+ol ol ul,ol ul ul,ol menu ul,ol dir ul,ol ol menu,ol ul menu,ol menu menu,ol dir menu,ol ol dir,ol ul dir,ol menu dir,ol dir dir,ul ol ul,ul ul ul,ul menu ul,ul dir ul,ul ol menu,ul ul menu,ul menu menu,ul dir menu,ul ol dir,ul ul dir,ul menu dir,ul dir dir,menu ol ul,menu ul ul,menu menu ul,menu dir ul,menu ol menu,menu ul menu,menu menu menu,menu dir menu,menu ol dir,menu ul dir,menu menu dir,menu dir dir,dir ol ul,dir ul ul,dir menu ul,dir dir ul,dir ol menu,dir ul menu,dir menu menu,dir dir menu,dir ol dir,dir ul dir,dir menu dir,dir dir dir{list-style-type:square;}
+.hidden{display:none;}
+p{line-height:1.5em;}
+h1{font-size:1.75em;line-height:1.7em;font-family:helvetica,verdana;}
+h2{font-size:1.5em;line-height:1.7em;font-family:helvetica,verdana;}
+h3{font-size:1.25em;line-height:1.7em;font-family:helvetica,verdana;}
+h4{font-size:1em;line-height:1.7em;font-family:helvetica,verdana;}
+html,body{width:100%;height:100%;}
+body{margin:0;padding:0;background-color:#ffffff;position:relative;font:16px/24px "NobileRegular","Lucida Grande",Lucida,Verdana,sans-serif;}
+a{color:#1b61d6;text-decoration:none;}
+a:hover{color:#e88f00;text-decoration:underline;}
+body h1,
+body h2,
+body h3,
+body h4,
+body h5,
+body h6{font-family:"NeutonRegular","Lucida Grande",Lucida,Verdana,sans-serif;font-weight:normal;color:#373839;font-style:normal;}
+#wrap{min-height:100%;}
+#header,#footer{width:100%;color:#ffffff;height:40px;position:absolute;text-align:center;line-height:40px;overflow:hidden;font-size:12px;vertical-align:middle;}
+#header{background:#000000;top:0;font-size:14px;}
+#footer{bottom:0;background:#000000 url(footerbg.png) repeat-x 0 top;position:relative;margin-top:-40px;clear:both;}
+.header,.footer{width:750px;margin-right:auto;margin-left:auto;}
+.wrapper{width:100%}
+#top,#top-small,#bottom{width:100%;}
+#top{color:#000000;height:230px;background:#ffffff url(headerbg.png) repeat-x 0 top;position:relative;}
+#top-small{color:#000000;height:60px;background:#ffffff url(headerbg.png) repeat-x 0 top;position:relative;}
+#bottom{color:#222;background-color:#ffffff;}
+.top,.top-small,.middle,.bottom{width:750px;margin-right:auto;margin-left:auto;}
+.top{padding-top:40px;}
+.top-small{padding-top:10px;}
+#middle{width:100%;height:100px;background:url(middlebg.png) repeat-x;border-top:2px solid #ffffff;border-bottom:2px solid #b2b2b2;}
+.app-welcome{margin-top:25px;}
+.app-name{color:#000000;font-weight:bold;}
+.bottom{padding-top:50px;}
+#left{width:350px;float:left;padding-right:25px;}
+#right{width:350px;float:right;padding-left:25px;}
+.align-left{text-align:left;}
+.align-right{text-align:right;}
+.align-center{text-align:center;}
+ul.links{margin:0;padding:0;}
+ul.links li{list-style-type:none;font-size:14px;}
+form{border-style:none;}
+fieldset{border-style:none;}
+input{color:#222;border:1px solid #ccc;font-family:sans-serif;font-size:12px;line-height:16px;}
+input[type=text],input[type=password]{width:205px;}
+input[type=submit]{background-color:#ddd;font-weight:bold;}
+/*Opera Fix*/
+body:before{content:"";height:100%;float:left;width:0;margin-top:-32767px;}
diff --git a/tests/test_scaffolds/fixture_scaffold/+package+/static/pyramid-small.png b/tests/test_scaffolds/fixture_scaffold/+package+/static/pyramid-small.png
new file mode 100644
index 000000000..a5bc0ade7
--- /dev/null
+++ b/tests/test_scaffolds/fixture_scaffold/+package+/static/pyramid-small.png
Binary files differ
diff --git a/tests/test_scaffolds/fixture_scaffold/+package+/static/pyramid.png b/tests/test_scaffolds/fixture_scaffold/+package+/static/pyramid.png
new file mode 100644
index 000000000..347e05549
--- /dev/null
+++ b/tests/test_scaffolds/fixture_scaffold/+package+/static/pyramid.png
Binary files differ
diff --git a/tests/test_scaffolds/fixture_scaffold/+package+/static/transparent.gif b/tests/test_scaffolds/fixture_scaffold/+package+/static/transparent.gif
new file mode 100644
index 000000000..0341802e5
--- /dev/null
+++ b/tests/test_scaffolds/fixture_scaffold/+package+/static/transparent.gif
Binary files differ
diff --git a/tests/test_scaffolds/fixture_scaffold/+package+/templates/mytemplate.pt_tmpl b/tests/test_scaffolds/fixture_scaffold/+package+/templates/mytemplate.pt_tmpl
new file mode 100644
index 000000000..f4d98ec29
--- /dev/null
+++ b/tests/test_scaffolds/fixture_scaffold/+package+/templates/mytemplate.pt_tmpl
@@ -0,0 +1,76 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" xmlns:tal="http://xml.zope.org/namespaces/tal">
+<head>
+ <title>The Pyramid Web Framework</title>
+ <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
+ <meta name="keywords" content="python web application" />
+ <meta name="description" content="pyramid web application" />
+ <link rel="shortcut icon" href="${request.static_url('{{package}}:static/favicon.ico')}" />
+ <link rel="stylesheet" href="${request.static_url('{{package}}:static/pylons.css')}" type="text/css" media="screen" charset="utf-8" />
+ <link rel="stylesheet" href="http://static.pylonsproject.org/fonts/nobile/stylesheet.css" media="screen" />
+ <link rel="stylesheet" href="http://static.pylonsproject.org/fonts/neuton/stylesheet.css" media="screen" />
+ <!--[if lte IE 6]>
+ <link rel="stylesheet" href="${request.static_url('{{package}}:static/ie6.css')}" type="text/css" media="screen" charset="utf-8" />
+ <![endif]-->
+</head>
+<body>
+ <div id="wrap">
+ <div id="top">
+ <div class="top align-center">
+ <div><img src="${request.static_url('{{package}}:static/pyramid.png')}" width="750" height="169" alt="pyramid"/></div>
+ </div>
+ </div>
+ <div id="middle">
+ <div class="middle align-center">
+ <p class="app-welcome">
+ Welcome to <span class="app-name">${project}</span>, an application generated by<br/>
+ the Pyramid Web Framework.
+ </p>
+ </div>
+ </div>
+ <div id="bottom">
+ <div class="bottom">
+ <div id="left" class="align-right">
+ <h2>Search documentation</h2>
+ <form method="get" action="http://docs.pylonsproject.org/projects/pyramid/current/search.html">
+ <input type="text" id="q" name="q" value="" />
+ <input type="submit" id="x" value="Go" />
+ </form>
+ </div>
+ <div id="right" class="align-left">
+ <h2>Pyramid links</h2>
+ <ul class="links">
+ <li>
+ <a href="https://pylonsproject.org">Pylons Website</a>
+ </li>
+ <li>
+ <a href="http://docs.pylonsproject.org/projects/pyramid/current/#narrative-documentation">Narrative Documentation</a>
+ </li>
+ <li>
+ <a href="http://docs.pylonsproject.org/projects/pyramid/current/#api-documentation">API Documentation</a>
+ </li>
+ <li>
+ <a href="http://docs.pylonsproject.org/projects/pyramid/current/#tutorials">Tutorials</a>
+ </li>
+ <li>
+ <a href="http://docs.pylonsproject.org/projects/pyramid/current/#change-history">Change History</a>
+ </li>
+ <li>
+ <a href="http://docs.pylonsproject.org/projects/pyramid/current/#sample-applications">Sample Applications</a>
+ </li>
+ <li>
+ <a href="http://docs.pylonsproject.org/projects/pyramid/current/#support-and-development">Support and Development</a>
+ </li>
+ <li>
+ <a href="irc://irc.freenode.net#pyramid">IRC Channel</a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div id="footer">
+ <div class="footer">&copy; Copyright 2008-2011, Agendaless Consulting.</div>
+ </div>
+</body>
+</html>
diff --git a/tests/test_scaffolds/fixture_scaffold/+package+/test_no_content.py_tmpl b/tests/test_scaffolds/fixture_scaffold/+package+/test_no_content.py_tmpl
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/test_scaffolds/fixture_scaffold/+package+/test_no_content.py_tmpl
diff --git a/tests/test_scaffolds/fixture_scaffold/+package+/tests.py_tmpl b/tests/test_scaffolds/fixture_scaffold/+package+/tests.py_tmpl
new file mode 100644
index 000000000..1627bf015
--- /dev/null
+++ b/tests/test_scaffolds/fixture_scaffold/+package+/tests.py_tmpl
@@ -0,0 +1,16 @@
+import unittest
+
+from pyramid import testing
+
+class ViewTests(unittest.TestCase):
+ def setUp(self):
+ self.config = testing.setUp()
+
+ def tearDown(self):
+ testing.tearDown()
+
+ def test_my_view(self):
+ from {{package}}.views import my_view
+ request = testing.DummyRequest()
+ info = my_view(request)
+ self.assertEqual(info['project'], '{{project}}')
diff --git a/tests/test_scaffolds/fixture_scaffold/+package+/views.py_tmpl b/tests/test_scaffolds/fixture_scaffold/+package+/views.py_tmpl
new file mode 100644
index 000000000..12ed8832d
--- /dev/null
+++ b/tests/test_scaffolds/fixture_scaffold/+package+/views.py_tmpl
@@ -0,0 +1,2 @@
+def my_view(request):
+ return {'project':'{{project}}'}
diff --git a/tests/test_scaffolds/fixture_scaffold/CHANGES.txt_tmpl b/tests/test_scaffolds/fixture_scaffold/CHANGES.txt_tmpl
new file mode 100644
index 000000000..35a34f332
--- /dev/null
+++ b/tests/test_scaffolds/fixture_scaffold/CHANGES.txt_tmpl
@@ -0,0 +1,4 @@
+0.0
+---
+
+- Initial version
diff --git a/tests/test_scaffolds/fixture_scaffold/MANIFEST.in_tmpl b/tests/test_scaffolds/fixture_scaffold/MANIFEST.in_tmpl
new file mode 100644
index 000000000..0ff6eb7a0
--- /dev/null
+++ b/tests/test_scaffolds/fixture_scaffold/MANIFEST.in_tmpl
@@ -0,0 +1,2 @@
+include *.txt *.ini *.cfg *.rst
+recursive-include {{package}} *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml
diff --git a/tests/test_scaffolds/fixture_scaffold/README.txt_tmpl b/tests/test_scaffolds/fixture_scaffold/README.txt_tmpl
new file mode 100644
index 000000000..40f98d14a
--- /dev/null
+++ b/tests/test_scaffolds/fixture_scaffold/README.txt_tmpl
@@ -0,0 +1 @@
+{{project}} README
diff --git a/tests/test_scaffolds/fixture_scaffold/development.ini_tmpl b/tests/test_scaffolds/fixture_scaffold/development.ini_tmpl
new file mode 100644
index 000000000..01c504f99
--- /dev/null
+++ b/tests/test_scaffolds/fixture_scaffold/development.ini_tmpl
@@ -0,0 +1,45 @@
+[app:main]
+use = egg:{{project}}
+
+pyramid.reload_templates = true
+pyramid.debug_authorization = false
+pyramid.debug_notfound = false
+pyramid.debug_routematch = false
+pyramid.debug_templates = true
+pyramid.default_locale_name = en
+pyramid.includes = pyramid_debugtoolbar
+
+[server:main]
+use = egg:pyramid#wsgiref
+listen = *:6543
+
+# Begin logging configuration
+
+[loggers]
+keys = root, {{package_logger}}
+
+[handlers]
+keys = console
+
+[formatters]
+keys = generic
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_{{package_logger}}]
+level = DEBUG
+handlers =
+qualname = {{package}}
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[formatter_generic]
+format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
+
+# End logging configuration
diff --git a/tests/test_scaffolds/fixture_scaffold/production.ini_tmpl b/tests/test_scaffolds/fixture_scaffold/production.ini_tmpl
new file mode 100644
index 000000000..becd3aa76
--- /dev/null
+++ b/tests/test_scaffolds/fixture_scaffold/production.ini_tmpl
@@ -0,0 +1,44 @@
+[app:main]
+use = egg:{{project}}
+
+pyramid.reload_templates = false
+pyramid.debug_authorization = false
+pyramid.debug_notfound = false
+pyramid.debug_routematch = false
+pyramid.debug_templates = false
+pyramid.default_locale_name = en
+
+[server:main]
+use = egg:pyramid#wsgiref
+listen = *:6543
+
+# Begin logging configuration
+
+[loggers]
+keys = root, {{package_logger}}
+
+[handlers]
+keys = console
+
+[formatters]
+keys = generic
+
+[logger_root]
+level = WARN
+handlers = console
+
+[logger_{{package_logger}}]
+level = WARN
+handlers =
+qualname = {{package}}
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[formatter_generic]
+format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
+
+# End logging configuration
diff --git a/tests/test_scaffolds/fixture_scaffold/setup.py_tmpl b/tests/test_scaffolds/fixture_scaffold/setup.py_tmpl
new file mode 100644
index 000000000..ee9fd5fda
--- /dev/null
+++ b/tests/test_scaffolds/fixture_scaffold/setup.py_tmpl
@@ -0,0 +1,38 @@
+import os
+
+from setuptools import setup, find_packages
+
+here = os.path.abspath(os.path.dirname(__file__))
+with open(os.path.join(here, 'README.txt')) as f:
+ README = f.read()
+with open(os.path.join(here, 'CHANGES.txt')) as f:
+ CHANGES = f.read()
+
+requires = ['pyramid', 'pyramid_debugtoolbar']
+
+setup(name='{{project}}',
+ version='0.0',
+ description='{{project}}',
+ long_description=README + '\n\n' + CHANGES,
+ classifiers=[
+ "Programming Language :: Python",
+ "Framework :: Pylons",
+ "Topic :: Internet :: WWW/HTTP",
+ "Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
+ ],
+ author='',
+ author_email='',
+ url='',
+ keywords='web pyramid pylons',
+ packages=find_packages(),
+ include_package_data=True,
+ zip_safe=False,
+ install_requires=requires,
+ tests_require=requires,
+ test_suite="{{package}}",
+ entry_points = """\
+ [paste.app_factory]
+ main = {{package}}:main
+ """,
+ )
+
diff --git a/tests/test_scaffolds/test_copydir.py b/tests/test_scaffolds/test_copydir.py
new file mode 100644
index 000000000..1e92b3c36
--- /dev/null
+++ b/tests/test_scaffolds/test_copydir.py
@@ -0,0 +1,455 @@
+# -*- coding: utf-8 -*-
+import unittest
+import os
+import pkg_resources
+
+class Test_copy_dir(unittest.TestCase):
+ def setUp(self):
+ import tempfile
+ from pyramid.compat import NativeIO
+ self.dirname = tempfile.mkdtemp()
+ self.out = NativeIO()
+ self.fixturetuple = ('pyramid.tests.test_scaffolds',
+ 'fixture_scaffold')
+
+ def tearDown(self):
+ import shutil
+ shutil.rmtree(self.dirname, ignore_errors=True)
+ self.out.close()
+
+ def _callFUT(self, *arg, **kw):
+ kw['out_'] = self.out
+ from pyramid.scaffolds.copydir import copy_dir
+ return copy_dir(*arg, **kw)
+
+ def test_copy_source_as_pkg_resource(self):
+ vars = {'package':'mypackage'}
+ self._callFUT(self.fixturetuple,
+ self.dirname,
+ vars,
+ 1, False,
+ template_renderer=dummy_template_renderer)
+ result = self.out.getvalue()
+ self.assertTrue('Creating' in result)
+ self.assertTrue(
+ 'Copying fixture_scaffold/+package+/__init__.py_tmpl to' in result)
+ source = pkg_resources.resource_filename(
+ 'pyramid.tests.test_scaffolds',
+ 'fixture_scaffold/+package+/__init__.py_tmpl')
+ target = os.path.join(self.dirname, 'mypackage', '__init__.py')
+ with open(target, 'r') as f:
+ tcontent = f.read()
+ with open(source, 'r') as f:
+ scontent = f.read()
+ self.assertEqual(scontent, tcontent)
+
+ def test_copy_source_as_dirname(self):
+ vars = {'package':'mypackage'}
+ source = pkg_resources.resource_filename(*self.fixturetuple)
+ self._callFUT(source,
+ self.dirname,
+ vars,
+ 1, False,
+ template_renderer=dummy_template_renderer)
+ result = self.out.getvalue()
+ self.assertTrue('Creating' in result)
+ self.assertTrue('Copying __init__.py_tmpl to' in result)
+ source = pkg_resources.resource_filename(
+ 'pyramid.tests.test_scaffolds',
+ 'fixture_scaffold/+package+/__init__.py_tmpl')
+ target = os.path.join(self.dirname, 'mypackage', '__init__.py')
+ with open(target, 'r') as f:
+ tcontent = f.read()
+ with open(source, 'r') as f:
+ scontent = f.read()
+ self.assertEqual(scontent, tcontent)
+
+ def test_content_is_same_message(self):
+ vars = {'package':'mypackage'}
+ source = pkg_resources.resource_filename(*self.fixturetuple)
+ self._callFUT(source,
+ self.dirname,
+ vars,
+ 2, False,
+ template_renderer=dummy_template_renderer)
+ self._callFUT(source,
+ self.dirname,
+ vars,
+ 2, False,
+ template_renderer=dummy_template_renderer)
+ result = self.out.getvalue()
+ self.assertTrue('%s already exists (same content)' % \
+ os.path.join(self.dirname, 'mypackage', '__init__.py') in result)
+
+ def test_direxists_message(self):
+ vars = {'package':'mypackage'}
+ source = pkg_resources.resource_filename(*self.fixturetuple)
+ # if not os.path.exists(self.dirname):
+ # os.mkdir(self.dirname)
+ self._callFUT(source,
+ self.dirname,
+ vars,
+ 2, False,
+ template_renderer=dummy_template_renderer)
+ result = self.out.getvalue()
+ self.assertTrue('Directory %s exists' % self.dirname in result, result)
+
+ def test_overwrite_false(self):
+ vars = {'package':'mypackage'}
+ source = pkg_resources.resource_filename(*self.fixturetuple)
+ self._callFUT(source,
+ self.dirname,
+ vars,
+ 1, False,
+ overwrite=False,
+ template_renderer=dummy_template_renderer)
+ # toplevel file
+ toplevel = os.path.join(self.dirname, 'mypackage', '__init__.py')
+ with open(toplevel, 'w') as f:
+ f.write('These are the words you are looking for.')
+ # sub directory file
+ sub = os.path.join(self.dirname, 'mypackage', 'templates', 'mytemplate.pt')
+ with open(sub, 'w') as f:
+ f.write('These are the words you are looking for.')
+ self._callFUT(source,
+ self.dirname,
+ vars,
+ 1, False,
+ overwrite=False,
+ template_renderer=dummy_template_renderer)
+ with open(toplevel, 'r') as f:
+ tcontent = f.read()
+ self.assertEqual('These are the words you are looking for.', tcontent)
+ with open(sub, 'r') as f:
+ tcontent = f.read()
+ self.assertEqual('These are the words you are looking for.', tcontent)
+
+ def test_overwrite_true(self):
+ vars = {'package':'mypackage'}
+ source = pkg_resources.resource_filename(*self.fixturetuple)
+ self._callFUT(source,
+ self.dirname,
+ vars,
+ 1, False,
+ overwrite=True,
+ template_renderer=dummy_template_renderer)
+ # toplevel file
+ toplevel = os.path.join(self.dirname, 'mypackage', '__init__.py')
+ with open(toplevel, 'w') as f:
+ f.write('These are not the words you are looking for.')
+ # sub directory file
+ sub = os.path.join(self.dirname, 'mypackage', 'templates', 'mytemplate.pt')
+ with open(sub, 'w') as f:
+ f.write('These are not the words you are looking for.')
+ self._callFUT(source,
+ self.dirname,
+ vars,
+ 1, False,
+ overwrite=True,
+ template_renderer=dummy_template_renderer)
+ with open(toplevel, 'r') as f:
+ tcontent = f.read()
+ self.assertNotEqual('These are not the words you are looking for.', tcontent)
+ with open(sub, 'r') as f:
+ tcontent = f.read()
+ self.assertNotEqual('These are not the words you are looking for.', tcontent)
+
+ def test_detect_SkipTemplate(self):
+ vars = {'package':'mypackage'}
+ source = pkg_resources.resource_filename(*self.fixturetuple)
+ def dummy_template_renderer(*args, **kwargs):
+ from pyramid.scaffolds.copydir import SkipTemplate
+ raise SkipTemplate
+ self._callFUT(source,
+ self.dirname,
+ vars,
+ 1, False,
+ template_renderer=dummy_template_renderer)
+
+ def test_query_interactive(self):
+ from pyramid.scaffolds import copydir
+ vars = {'package':'mypackage'}
+ source = pkg_resources.resource_filename(*self.fixturetuple)
+ self._callFUT(source,
+ self.dirname,
+ vars,
+ 1, False,
+ overwrite=False,
+ template_renderer=dummy_template_renderer)
+ target = os.path.join(self.dirname, 'mypackage', '__init__.py')
+ with open(target, 'w') as f:
+ f.write('These are not the words you are looking for.')
+ # We need query_interactive to return False in order to force
+ # execution of a branch
+ original_code_object = copydir.query_interactive
+ copydir.query_interactive = lambda *args, **kwargs: False
+ self._callFUT(source,
+ self.dirname,
+ vars,
+ 1, False,
+ interactive=True,
+ overwrite=False,
+ template_renderer=dummy_template_renderer)
+ copydir.query_interactive = original_code_object
+
+class Test_raise_SkipTemplate(unittest.TestCase):
+
+ def _callFUT(self, *arg, **kw):
+ from pyramid.scaffolds.copydir import skip_template
+ return skip_template(*arg, **kw)
+
+ def test_raise_SkipTemplate(self):
+ from pyramid.scaffolds.copydir import SkipTemplate
+ self.assertRaises(SkipTemplate,
+ self._callFUT, True, "exc-message")
+
+class Test_makedirs(unittest.TestCase):
+
+ def _callFUT(self, *arg, **kw):
+ from pyramid.scaffolds.copydir import makedirs
+ return makedirs(*arg, **kw)
+
+ def test_makedirs_parent_dir(self):
+ import shutil
+ import tempfile
+ tmpdir = tempfile.mkdtemp()
+ target = os.path.join(tmpdir, 'nonexistent_subdir')
+ self._callFUT(target, 2, None)
+ shutil.rmtree(tmpdir)
+
+ def test_makedirs_no_parent_dir(self):
+ import shutil
+ import tempfile
+ tmpdir = tempfile.mkdtemp()
+ target = os.path.join(tmpdir, 'nonexistent_subdir', 'non2')
+ self._callFUT(target, 2, None)
+ shutil.rmtree(tmpdir)
+
+class Test_support_functions(unittest.TestCase):
+
+ def _call_html_quote(self, *arg, **kw):
+ from pyramid.scaffolds.copydir import html_quote
+ return html_quote(*arg, **kw)
+
+ def _call_url_quote(self, *arg, **kw):
+ from pyramid.scaffolds.copydir import url_quote
+ return url_quote(*arg, **kw)
+
+ def _call_test(self, *arg, **kw):
+ from pyramid.scaffolds.copydir import test
+ return test(*arg, **kw)
+
+ def test_html_quote(self):
+ import string
+ s = None
+ self.assertEqual(self._call_html_quote(s), '')
+ s = string.ascii_letters
+ self.assertEqual(self._call_html_quote(s), s)
+ s = "Λεμεσός"
+ self.assertEqual(self._call_url_quote(s),
+ "%CE%9B%CE%B5%CE%BC%CE%B5%CF%83%CF%8C%CF%82")
+
+ def test_url_quote(self):
+ import string
+ s = None
+ self.assertEqual(self._call_url_quote(s), '')
+ s = string.ascii_letters
+ self.assertEqual(self._call_url_quote(s), s)
+ s = "Λεμεσός"
+ self.assertEqual(self._call_url_quote(s),
+ "%CE%9B%CE%B5%CE%BC%CE%B5%CF%83%CF%8C%CF%82")
+
+ def test_test(self):
+ conf = True
+ true_cond = "faked"
+ self.assertEqual(self._call_test(
+ conf, true_cond, false_cond=None), "faked")
+ conf = False
+ self.assertEqual(self._call_test(
+ conf, true_cond, false_cond="alsofaked"), "alsofaked")
+
+
+class Test_should_skip_file(unittest.TestCase):
+
+ def _callFUT(self, *arg, **kw):
+ from pyramid.scaffolds.copydir import should_skip_file
+ return should_skip_file(*arg, **kw)
+
+ def test_should_skip_dot_hidden_file(self):
+ self.assertEqual(
+ self._callFUT('.a_filename'),
+ 'Skipping hidden file %(filename)s')
+
+ def test_should_skip_backup_file(self):
+ for name in ('a_filename~', 'a_filename.bak'):
+ self.assertEqual(
+ self._callFUT(name),
+ 'Skipping backup file %(filename)s')
+
+ def test_should_skip_bytecompiled_file(self):
+ for name in ('afilename.pyc', 'afilename.pyo'):
+ extension = os.path.splitext(name)[1]
+ self.assertEqual(
+ self._callFUT(name),
+ 'Skipping %s file ' % extension + '%(filename)s')
+
+ def test_should_skip_jython_class_file(self):
+ self.assertEqual(
+ self._callFUT('afilename$py.class'),
+ 'Skipping $py.class file %(filename)s')
+
+ def test_should_skip_version_control_directory(self):
+ for name in ('CVS', '_darcs'):
+ self.assertEqual(
+ self._callFUT(name),
+ 'Skipping version control directory %(filename)s')
+
+ def test_valid_file_is_not_skipped(self):
+ self.assertEqual(
+ self._callFUT('a_filename'), None)
+
+class RawInputMockObject( object ):
+ count = 0
+ def __init__( self, fake_input ):
+ self.input= fake_input
+ self.count = 0
+ def __call__( self, prompt ):
+ # Don't cycle endlessly.
+ self.count += 1
+ if self.count > 1:
+ return 'y'
+ else:
+ return self.input
+
+class Test_query_interactive(unittest.TestCase):
+
+ def setUp(self):
+ import tempfile
+ from pyramid.compat import NativeIO
+ self.dirname = tempfile.mkdtemp()
+ self.out = NativeIO()
+ self.fixturetuple = ('pyramid.tests.test_scaffolds',
+ 'fixture_scaffold')
+ self.src_content = """\
+These are not the droids
+that you are looking for."""
+ self.dest_content = """\
+These are the droids for
+whom you are looking;
+now you have found them."""
+ self.src_fn = os.path.join(self.dirname, 'mypackage', '__init__.py')
+ self.dest_fn = os.path.join(self.dirname, 'mypackage', '__init__.py')
+ # query_interactive is only normally executed when the destination
+ # is discovered to be already occupied by existing files, so ...
+ # create the required occupancy.
+ from pyramid.scaffolds.copydir import copy_dir
+ copy_dir(self.fixturetuple,
+ self.dirname,
+ {'package':'mypackage'},
+ 0, False,
+ template_renderer=dummy_template_renderer)
+
+ def tearDown(self):
+ import shutil
+ shutil.rmtree(self.dirname, ignore_errors=True)
+ self.out.close()
+
+ def _callFUT(self, *arg, **kw):
+ from pyramid.scaffolds.copydir import query_interactive
+ return query_interactive(*arg, **kw)
+
+ def test_query_interactive_0y(self):
+ from pyramid.scaffolds import copydir
+ copydir.input_ = RawInputMockObject("y")
+ self._callFUT(self.src_fn, self.dest_fn,
+ self.src_content, self.dest_content,
+ simulate=False,
+ out_=self.out)
+ self.assertTrue("Replace" in self.out.getvalue())
+
+ def test_query_interactive_1n(self):
+ from pyramid.scaffolds import copydir
+ copydir.input_ = RawInputMockObject("n")
+ self._callFUT(self.src_fn, self.dest_fn,
+ self.src_content,
+ '\n'.join(self.dest_content.split('\n')[:-1]),
+ simulate=False,
+ out_=self.out)
+ self.assertTrue("Replace" in self.out.getvalue())
+
+ def test_query_interactive_2b(self):
+ from pyramid.scaffolds import copydir
+ copydir.input_ = RawInputMockObject("b")
+ with open(os.path.join(
+ self.dirname, 'mypackage', '__init__.py.bak'), 'w') as fp:
+ fp.write("")
+ fp.close()
+ self._callFUT(self.src_fn, self.dest_fn,
+ self.dest_content, self.src_content,
+ simulate=False,
+ out_=self.out)
+ self.assertTrue("Backing up" in self.out.getvalue())
+
+ def test_query_interactive_3d(self):
+ from pyramid.scaffolds import copydir
+ copydir.input_ = RawInputMockObject("d")
+ self._callFUT(self.src_fn, self.dest_fn,
+ self.dest_content, self.src_content,
+ simulate=False,
+ out_=self.out)
+ output = self.out.getvalue()
+ # The useful text in self.out gets wiped out on the second
+ # call to raw_input, otherwise the test could be made
+ # more usefully precise...
+ # print("3d", output)
+ # self.assertTrue("@@" in output, output)
+ self.assertTrue("Replace" in output)
+
+ def test_query_interactive_4dc(self):
+ from pyramid.scaffolds import copydir
+ copydir.input_ = RawInputMockObject("dc")
+ self._callFUT(self.src_fn, self.dest_fn,
+ self.dest_content, self.src_content,
+ simulate=False,
+ out_=self.out)
+ output = self.out.getvalue()
+ # The useful text in self.out gets wiped out on the second
+ # call to raw_input, otherwise, the test could be made
+ # more usefully precise...
+ # print("4dc", output)
+ # self.assertTrue("***" in output, output)
+ self.assertTrue("Replace" in output)
+
+ def test_query_interactive_5allbad(self):
+ from pyramid.scaffolds import copydir
+ copydir.input_ = RawInputMockObject("all z")
+ self._callFUT(self.src_fn, self.dest_fn,
+ self.src_content, self.dest_content,
+ simulate=False,
+ out_=self.out)
+ output = self.out.getvalue()
+ # The useful text in self.out gets wiped out on the second
+ # call to raw_input, otherwise the test could be made
+ # more usefully precise...
+ # print("5allbad", output)
+ # self.assertTrue("Responses" in output, output)
+ self.assertTrue("Replace" in output)
+
+ def test_query_interactive_6all(self):
+ from pyramid.scaffolds import copydir
+ copydir.input_ = RawInputMockObject("all b")
+ self._callFUT(self.src_fn, self.dest_fn,
+ self.src_content, self.dest_content,
+ simulate=False,
+ out_=self.out)
+ output = self.out.getvalue()
+ # The useful text in self.out gets wiped out on the second
+ # call to raw_input, otherwise the test could be made
+ # more usefully precise...
+ # print("6all", output)
+ # self.assertTrue("Responses" in output, output)
+ self.assertTrue("Replace" in output)
+
+def dummy_template_renderer(content, v, filename=None):
+ return content
+
diff --git a/tests/test_scaffolds/test_init.py b/tests/test_scaffolds/test_init.py
new file mode 100644
index 000000000..f4d1b287a
--- /dev/null
+++ b/tests/test_scaffolds/test_init.py
@@ -0,0 +1,21 @@
+import unittest
+
+class TestPyramidTemplate(unittest.TestCase):
+ def _makeOne(self):
+ from pyramid.scaffolds import PyramidTemplate
+ return PyramidTemplate('name')
+
+ def test_pre(self):
+ inst = self._makeOne()
+ vars = {'package':'one'}
+ inst.pre('command', 'output dir', vars)
+ self.assertTrue(vars['random_string'])
+ self.assertEqual(vars['package_logger'], 'one')
+
+ def test_pre_root(self):
+ inst = self._makeOne()
+ vars = {'package':'root'}
+ inst.pre('command', 'output dir', vars)
+ self.assertTrue(vars['random_string'])
+ self.assertEqual(vars['package_logger'], 'app')
+
diff --git a/tests/test_scaffolds/test_template.py b/tests/test_scaffolds/test_template.py
new file mode 100644
index 000000000..98f2daf73
--- /dev/null
+++ b/tests/test_scaffolds/test_template.py
@@ -0,0 +1,155 @@
+import unittest
+
+from pyramid.compat import bytes_
+
+class TestTemplate(unittest.TestCase):
+ def _makeOne(self, name='whatever'):
+ from pyramid.scaffolds.template import Template
+ return Template(name)
+
+ def test_render_template_success(self):
+ inst = self._makeOne()
+ result = inst.render_template('{{a}} {{b}}', {'a':'1', 'b':'2'})
+ self.assertEqual(result, bytes_('1 2'))
+
+ def test_render_template_expr_failure(self):
+ inst = self._makeOne()
+ self.assertRaises(AttributeError, inst.render_template,
+ '{{a.foo}}', {'a':'1', 'b':'2'})
+
+ def test_render_template_expr_success(self):
+ inst = self._makeOne()
+ result = inst.render_template('{{a.lower()}}', {'a':'A'})
+ self.assertEqual(result, b'a')
+
+ def test_render_template_expr_success_via_pipe(self):
+ inst = self._makeOne()
+ result = inst.render_template('{{b|c|a.lower()}}', {'a':'A'})
+ self.assertEqual(result, b'a')
+
+ def test_render_template_expr_success_via_pipe2(self):
+ inst = self._makeOne()
+ result = inst.render_template('{{b|a.lower()|c}}', {'a':'A'})
+ self.assertEqual(result, b'a')
+
+ def test_render_template_expr_value_is_None(self):
+ inst = self._makeOne()
+ result = inst.render_template('{{a}}', {'a':None})
+ self.assertEqual(result, b'')
+
+ def test_render_template_with_escaped_double_braces(self):
+ inst = self._makeOne()
+ result = inst.render_template('{{a}} {{b}} \{\{a\}\} \{\{c\}\}', {'a':'1', 'b':'2'})
+ self.assertEqual(result, bytes_('1 2 {{a}} {{c}}'))
+
+ def test_render_template_with_breaking_escaped_braces(self):
+ inst = self._makeOne()
+ result = inst.render_template('{{a}} {{b}} \{\{a\} \{b\}\}', {'a':'1', 'b':'2'})
+ self.assertEqual(result, bytes_('1 2 \{\{a\} \{b\}\}'))
+
+ def test_render_template_with_escaped_single_braces(self):
+ inst = self._makeOne()
+ result = inst.render_template('{{a}} {{b}} \{a\} \{b', {'a':'1', 'b':'2'})
+ self.assertEqual(result, bytes_('1 2 \{a\} \{b'))
+
+ def test_module_dir(self):
+ import sys
+ import pkg_resources
+ package = sys.modules['pyramid.scaffolds.template']
+ path = pkg_resources.resource_filename(package.__name__, '')
+ inst = self._makeOne()
+ result = inst.module_dir()
+ self.assertEqual(result, path)
+
+ def test_template_dir__template_dir_is_None(self):
+ inst = self._makeOne()
+ self.assertRaises(AssertionError, inst.template_dir)
+
+ def test_template_dir__template_dir_is_tuple(self):
+ inst = self._makeOne()
+ inst._template_dir = ('a', 'b')
+ self.assertEqual(inst.template_dir(), ('a', 'b'))
+
+ def test_template_dir__template_dir_is_not_None(self):
+ import os
+ import sys
+ import pkg_resources
+ package = sys.modules['pyramid.scaffolds.template']
+ path = pkg_resources.resource_filename(package.__name__, '')
+ inst = self._makeOne()
+ inst._template_dir ='foo'
+ result = inst.template_dir()
+ self.assertEqual(result, os.path.join(path, 'foo'))
+
+ def test_write_files_path_exists(self):
+ import os
+ import sys
+ import pkg_resources
+ package = sys.modules['pyramid.scaffolds.template']
+ path = pkg_resources.resource_filename(package.__name__, '')
+ inst = self._makeOne()
+ inst._template_dir = 'foo'
+ inst.exists = lambda *arg: True
+ copydir = DummyCopydir()
+ inst.copydir = copydir
+ command = DummyCommand()
+ inst.write_files(command, 'output dir', {'a':1})
+ self.assertEqual(copydir.template_dir, os.path.join(path, 'foo'))
+ self.assertEqual(copydir.output_dir, 'output dir')
+ self.assertEqual(copydir.vars, {'a':1})
+ self.assertEqual(copydir.kw,
+ {'template_renderer':inst.render_template,
+ 'indent':1,
+ 'verbosity':1,
+ 'simulate':False,
+ 'overwrite':False,
+ 'interactive':False,
+ })
+
+ def test_write_files_path_missing(self):
+ L = []
+ inst = self._makeOne()
+ inst._template_dir = 'foo'
+ inst.exists = lambda *arg: False
+ inst.out = lambda *arg: None
+ inst.makedirs = lambda dir: L.append(dir)
+ copydir = DummyCopydir()
+ inst.copydir = copydir
+ command = DummyCommand()
+ inst.write_files(command, 'output dir', {'a':1})
+ self.assertEqual(L, ['output dir'])
+
+ def test_run(self):
+ L = []
+ inst = self._makeOne()
+ inst._template_dir = 'foo'
+ inst.exists = lambda *arg: False
+ inst.out = lambda *arg: None
+ inst.makedirs = lambda dir: L.append(dir)
+ copydir = DummyCopydir()
+ inst.copydir = copydir
+ command = DummyCommand()
+ inst.run(command, 'output dir', {'a':1})
+ self.assertEqual(L, ['output dir'])
+
+ def test_check_vars(self):
+ inst = self._makeOne()
+ self.assertRaises(RuntimeError, inst.check_vars, 'one', 'two')
+
+class DummyCopydir(object):
+ def copy_dir(self, template_dir, output_dir, vars, **kw):
+ self.template_dir = template_dir
+ self.output_dir = output_dir
+ self.vars = vars
+ self.kw = kw
+
+class DummyArgs(object):
+ simulate = False
+ overwrite = False
+ interactive = False
+
+class DummyCommand(object):
+ args = DummyArgs()
+ verbosity = 1
+
+