예제 #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
파일: test_scaffold.py 프로젝트: ow6n/opal
 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
파일: test_scaffold.py 프로젝트: ow6n/opal
 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)