Skip to content

Commit

Permalink
Merge branch 'v0.8.2' into startplugin-css
Browse files Browse the repository at this point in the history
  • Loading branch information
fredkingham committed Apr 26, 2017
2 parents 1d1ba7f + 1eade0d commit 04e4ee9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Opal

Opal is a full stack web framework that makes building digital tools for health care easy.

It builds on established Open Source technologies with a track record of helping developers
It builds on established open source technologies with a track record of helping developers
build easy to maintain, robust applications.

Most notably, it makes use of [Django](https://djangoproject.com/), [AngularJS](https://angularjs.org/)
Expand All @@ -17,7 +17,7 @@ and [Bootstrap](http://getbootstrap.com/).
From there, Opal provides you with a common batteries-included architecture for writing healthcare
applications, and a composable modular framework that takes advantage of generic, re-usable components.

Opal is entirely Open ([Source](https://github.com/openhealthcare/opal) &
Opal is entirely open ([source](https://github.com/openhealthcare/opal) &
[Governance](https://github.com/openhealthcare/opal/issues)) as are the wide library of plugins.

Opal was created by [Open Health Care UK](http://openhealthcare.org.uk), because it makes Healthcare IT Less Bad.
Expand Down
3 changes: 3 additions & 0 deletions opal/core/scaffold.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ def start_plugin(name, USERLAND):
controllers.mkdir()
services = jsdir/'services'
services.mkdir()
# 5. Initialize git repo
os.system('cd {0}; git init'.format(name))

write('Plugin complete at {0}'.format(reponame))
return

Expand Down
2 changes: 1 addition & 1 deletion opal/scaffolding/scaffold/app/settings.py.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -267,5 +267,5 @@ REST_FRAMEWORK = {
try:
from local_settings import *
except:
except ImportError:
pass
26 changes: 15 additions & 11 deletions opal/tests/test_scaffold.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
)
from opal.core import scaffold


@patch('os.system')
class StartpluginTestCase(OpalTestCase):
def setUp(self):
self.path = ffs.Path.newdir()
Expand All @@ -28,54 +28,55 @@ def tearDown(self):
ffs.rm_r(self.path)

@patch("opal.core.scaffold.shutil.copytree", side_effect=shutil.copytree)
def test_tree_copied(self, shutil):
def test_tree_copied(self, shutil, os):
scaffold.start_plugin(self.args, self.path)
self.assertTrue(shutil.called)

def test_creates_the_app_directory(self):
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)

def test_creates_appropriate_directory_with_opal_prefix(self):
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)

def test_creates_template_directory(self):
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)

def test_creates_static_directory(self):
def test_creates_static_directory(self, os):
static_dir = self.path/'opal-testplugin/testplugin/static'
scaffold.start_plugin(self.args, self.path)
self.assertTrue(static_dir.is_dir)

def test_creates_css_directory(self):

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)

def test_creates_controllers_directory(self):
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)

def test_creates_services_directory(self):
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)

def test_has_lookuplists_dir(self):
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))

def test_creates_manifest(self):
def test_creates_manifest(self, os):
rpath = 'opal-testplugin/MANIFEST.in'
manifest = self.path/rpath
scaffold.start_plugin(self.args, self.path)
Expand All @@ -85,6 +86,9 @@ def test_creates_manifest(self):
self.assertIn("recursive-include testplugin/static *", contents)
self.assertIn("recursive-include testplugin/templates *", contents)

def test_initialize_git(self, os):
scaffold.start_plugin(self.args, self.path)
os.assert_any_call('cd testplugin; git init')

@patch('subprocess.check_call')
@patch('os.system')
Expand Down

0 comments on commit 04e4ee9

Please sign in to comment.