Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding test for generate_site_pp function that now has a default pupp…
…et base class to apply to each role
- Loading branch information
Showing
2 changed files
with
29 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from pspec import describe | ||
from attest import assert_hook | ||
from fabric.api import env | ||
from loom.puppet import generate_site_pp, get_puppetmaster_host | ||
from mock import patch | ||
|
||
|
||
with describe('generate_site_pp'): | ||
def it_creates_an_include_statement_for_each_role(): | ||
env.roledefs = { | ||
'app': 'server.example.com', | ||
'db': 'server.example.com', | ||
} | ||
env.host_string = 'server.example.com' | ||
site_pp = generate_site_pp() | ||
assert 'include "roles::app"' in site_pp | ||
assert 'include "roles::db"' in site_pp | ||
|
||
with describe('generate_site_pp'): | ||
def it_creates_an_include_statement_for_each_role_and_puppet_base(): | ||
env.roledefs = { | ||
'app': 'server.example.com', | ||
} | ||
env.host_string = 'server.example.com' | ||
env.loom_puppet_base_class = 'roles::mybase' | ||
site_pp = generate_site_pp() | ||
|
||
assert 'include "roles::app"' in site_pp | ||
assert 'include "roles::mybase"' in site_pp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters