Skip to content
This repository was archived by the owner on Jan 19, 2018. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions atomicapp/nulecule/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@ def render(self, provider_key=None, dryrun=False):
if self._app:
self._app.render(provider_key=provider_key, dryrun=dryrun)
return
if self.artifacts is None:
raise NuleculeException(
"No artifacts specified in the Nulecule file")
context = self.get_context()
if provider_key and provider_key not in self.artifacts:
raise NuleculeException(
Expand Down
13 changes: 12 additions & 1 deletion tests/units/nulecule/test_nulecule_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def test_render_for_external_app(self):
provider_key = 'some-provider'
dryrun = False

nc = NuleculeComponent(name='some-app', basepath='some/path')
nc = NuleculeComponent(name='some-app', basepath='some/path', artifacts="/foo/bar")
nc._app = mock_nulecule
nc.render(provider_key, dryrun)

Expand All @@ -259,6 +259,17 @@ def test_render_for_local_app_with_missing_artifacts_for_provider(self):

self.assertRaises(NuleculeException, nc.render, provider_key, dryrun)

def test_render_for_local_app_with_missing_artifacts_from_nulecule(self):
"""
Test rendering a Nulecule component with no artifacts provided in the
Nulecule file.
"""
nc = NuleculeComponent(name='some-app', basepath='some/path')
nc.config = {}

with self.assertRaises(NuleculeException):
nc.render()

@mock.patch('atomicapp.nulecule.base.NuleculeComponent.get_context')
@mock.patch('atomicapp.nulecule.base.NuleculeComponent.'
'get_artifact_paths_for_provider')
Expand Down