示例#1
0
 def test_creates_requirements(self, os):
     rpath = 'opal-testplugin/requirements.txt'
     requirements = self.path/rpath
     scaffold.start_plugin(self.args, self.path)
     self.assertTrue(bool(requirements))
     with open(requirements) as r:
         contents = r.read()
         self.assertIn('opal=={}'.format(opal.__version__), contents)
示例#2
0
 def test_creates_requirements(self, os):
     rpath = 'opal-testplugin/requirements.txt'
     requirements = self.path / rpath
     scaffold.start_plugin(self.args, self.path)
     self.assertTrue(bool(requirements))
     with open(requirements) as r:
         contents = r.read()
         self.assertIn('opal=={}'.format(opal.__version__), contents)
示例#3
0
 def test_creates_manifest(self, os):
     rpath = 'opal-testplugin/MANIFEST.in'
     manifest = self.path/rpath
     scaffold.start_plugin(self.args, self.path)
     self.assertTrue(bool(manifest))
     with open(manifest) as m:
         contents = m.read()
         self.assertIn("recursive-include testplugin/static *", contents)
         self.assertIn("recursive-include testplugin/templates *", contents)
示例#4
0
 def test_creates_manifest(self, os):
     rpath = 'opal-testplugin/MANIFEST.in'
     manifest = self.path / rpath
     scaffold.start_plugin(self.args, self.path)
     self.assertTrue(bool(manifest))
     with open(manifest) as m:
         contents = m.read()
         self.assertIn("recursive-include testplugin/static *", contents)
         self.assertIn("recursive-include testplugin/templates *", contents)
示例#5
0
def startplugin(args):
    """
    The steps to create our plugin are:

    * Copy across the scaffold to our plugin directory
    * Interpolate our name into the appropriate places.
    * Rename the code dir
    * Create template/static directories
    """
    scaffold_utils.start_plugin(args.name, USERLAND_HERE)
    return
示例#6
0
def startplugin(args):
    """
    The steps to create our plugin are:

    * Copy across the scaffold to our plugin directory
    * Interpolate our name into the appropriate places.
    * Rename the code dir
    * Create template/static directories
    """
    scaffold_utils.start_plugin(args.name, USERLAND_HERE)
    return
示例#7
0
 def test_creates_appropriate_directory_with_opal_prefix(self, os):
     test_plugin = self.path / 'opal-testplugin/testplugin'
     scaffold.start_plugin("opal-testplugin", self.path)
     self.assertTrue(test_plugin.is_dir)
示例#8
0
 def test_tree_copied(self, shutil, os):
     scaffold.start_plugin(self.args, self.path)
     self.assertTrue(shutil.called)
示例#9
0
 def test_creates_the_app_directory(self, os):
     test_plugin = self.path / 'opal-testplugin/testplugin'
     scaffold.start_plugin(self.args, self.path)
     self.assertTrue(test_plugin.is_dir)
示例#10
0
 def test_tree_copied(self, cp_r, subpr):
     scaffold.start_plugin(self.args, self.path)
     self.assertTrue(cp_r.called)
示例#11
0
 def test_calls_interpolate_dir(self, os):
     with patch.object(scaffold, 'interpolate_dir') as interpolate:
         scaffold.start_plugin(self.args, self.path)
         self.assertEqual(interpolate.call_args[1]["name"], "testplugin")
         self.assertIn("version", interpolate.call_args[1])
示例#12
0
 def test_creates_css_directory(self, os):
     css_dir = self.path / 'opal-testplugin/testplugin/static/css'
     scaffold.start_plugin(self.args, self.path)
     self.assertTrue(css_dir.is_dir)
示例#13
0
 def test_creates_services_directory(self, os):
     rpath = 'opal-testplugin/testplugin/static/js/testplugin/services'
     services_dir = self.path / rpath
     scaffold.start_plugin(self.args, self.path)
     self.assertTrue(services_dir.is_dir)
示例#14
0
 def test_initialize_git(self, os):
     scaffold.start_plugin(self.args, self.path)
     os.assert_any_call('cd opal-testplugin; git init')
示例#15
0
 def test_creates_the_app_directory(self, os):
     test_plugin = self.path/'opal-testplugin/testplugin'
     scaffold.start_plugin(self.args, self.path)
     self.assertTrue(test_plugin.is_dir)
示例#16
0
 def test_has_lookuplists_dir(self, os):
     rpath = 'opal-testplugin/testplugin/data/lookuplists/'
     lookuplists = self.path/rpath
     scaffold.start_plugin(self.args, self.path)
     self.assertTrue(bool(lookuplists))
示例#17
0
 def test_creates_appropriate_directory_with_opal_prefix(self, os):
     test_plugin = self.path/'opal-testplugin/testplugin'
     scaffold.start_plugin("opal-testplugin", self.path)
     self.assertTrue(test_plugin.is_dir)
示例#18
0
 def test_creates_services_directory(self, os):
     rpath = 'opal-testplugin/testplugin/static/js/testplugin/services'
     services_dir = self.path/rpath
     scaffold.start_plugin(self.args, self.path)
     self.assertTrue(services_dir.is_dir)
示例#19
0
 def test_creates_controllers_directory(self, os):
     rpath = 'opal-testplugin/testplugin/static/js/testplugin/controllers'
     controllers_dir = self.path/rpath
     scaffold.start_plugin(self.args, self.path)
     self.assertTrue(controllers_dir.is_dir)
示例#20
0
 def test_creates_css_directory(self, os):
     css_dir = self.path/'opal-testplugin/testplugin/static/css'
     scaffold.start_plugin(self.args, self.path)
     self.assertTrue(css_dir.is_dir)
示例#21
0
 def test_creates_template_directory(self, os):
     template_dir = self.path / 'opal-testplugin/testplugin/templates'
     scaffold.start_plugin(self.args, self.path)
     self.assertTrue(template_dir.is_dir)
示例#22
0
 def test_tree_copied(self, shutil, os):
     scaffold.start_plugin(self.args, self.path)
     self.assertTrue(shutil.called)
示例#23
0
 def test_calls_interpolate_dir(self, os):
     with patch.object(scaffold, 'interpolate_dir') as interpolate:
         scaffold.start_plugin(self.args, self.path)
         self.assertEqual(interpolate.call_args[1]["name"], "testplugin")
         self.assertIn("version", interpolate.call_args[1])
示例#24
0
 def test_initialize_git(self, subpr):
     scaffold.start_plugin(self.args, self.path)
     subpr.assert_any_call(('git', 'init'),
                           cwd=self.path/'opal-testplugin',
                           stdout=subprocess.PIPE)
示例#25
0
 def test_creates_controllers_directory(self, os):
     rpath = 'opal-testplugin/testplugin/static/js/testplugin/controllers'
     controllers_dir = self.path / rpath
     scaffold.start_plugin(self.args, self.path)
     self.assertTrue(controllers_dir.is_dir)
示例#26
0
 def test_tree_copied(self, cp_r, subpr):
     scaffold.start_plugin(self.args, self.path)
     self.assertTrue(cp_r.called)
示例#27
0
 def test_has_lookuplists_dir(self, os):
     rpath = 'opal-testplugin/testplugin/data/lookuplists/'
     lookuplists = self.path / rpath
     scaffold.start_plugin(self.args, self.path)
     self.assertTrue(bool(lookuplists))
示例#28
0
 def test_creates_static_directory(self):
     static_dir = self.path/'opal-testplugin/testplugin/static'
     scaffold.start_plugin(self.args, self.path)
     self.assertTrue(static_dir.is_dir)
示例#29
0
 def test_initialize_git(self, os):
     scaffold.start_plugin(self.args, self.path)
     os.assert_any_call('cd opal-testplugin; git init')
示例#30
0
 def test_creates_template_directory(self, os):
     template_dir = self.path/'opal-testplugin/testplugin/templates'
     scaffold.start_plugin(self.args, self.path)
     self.assertTrue(template_dir.is_dir)
示例#31
0
 def test_initialize_git(self, subpr):
     scaffold.start_plugin(self.args, self.path)
     subpr.assert_any_call(('git', 'init'),
                           cwd=self.path / 'opal-testplugin',
                           stdout=subprocess.PIPE)
示例#32
0
 def test_creates_static_directory(self, subpr):
     static_dir = self.path/'opal-testplugin/testplugin/static'
     scaffold.start_plugin(self.args, self.path)
     self.assertTrue(static_dir.is_dir)