Example #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)
Example #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)
Example #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)
Example #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)
Example #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
Example #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
Example #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)
Example #8
0
 def test_tree_copied(self, shutil, os):
     scaffold.start_plugin(self.args, self.path)
     self.assertTrue(shutil.called)
Example #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)
Example #10
0
 def test_tree_copied(self, cp_r, subpr):
     scaffold.start_plugin(self.args, self.path)
     self.assertTrue(cp_r.called)
Example #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])
Example #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)
Example #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)
Example #14
0
 def test_initialize_git(self, os):
     scaffold.start_plugin(self.args, self.path)
     os.assert_any_call('cd opal-testplugin; git init')
Example #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)
Example #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))
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #22
0
 def test_tree_copied(self, shutil, os):
     scaffold.start_plugin(self.args, self.path)
     self.assertTrue(shutil.called)
Example #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])
Example #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)
Example #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)
Example #26
0
 def test_tree_copied(self, cp_r, subpr):
     scaffold.start_plugin(self.args, self.path)
     self.assertTrue(cp_r.called)
Example #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))
Example #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)
Example #29
0
 def test_initialize_git(self, os):
     scaffold.start_plugin(self.args, self.path)
     os.assert_any_call('cd opal-testplugin; git init')
Example #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)
Example #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)
Example #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)