aboutsummaryrefslogtreecommitdiff
path: root/tests/test_template_parser.py
diff options
context:
space:
mode:
authorBenjamin W. Smith <benjaminwarfield@just-another.net>2009-11-07 18:54:45 -0500
committerBenjamin W. Smith <benjaminwarfield@just-another.net>2009-11-07 18:54:45 -0500
commitb957efd57065b350a7e32fea5d70aae4bfccd33f (patch)
tree6e8f39ef95868d5e323b3d1c5501f33d562dda3d /tests/test_template_parser.py
parent077d64b5b49673b79cd99b9abc410f5b486a9e4c (diff)
downloadmrbelvedere-b957efd57065b350a7e32fea5d70aae4bfccd33f.tar.bz2
mrbelvedere-b957efd57065b350a7e32fea5d70aae4bfccd33f.tar.xz
mrbelvedere-b957efd57065b350a7e32fea5d70aae4bfccd33f.zip
Stub out template parser tests and code. Ignore .swp files (why hadn't I done that before?!)HEADmaster
Diffstat (limited to 'tests/test_template_parser.py')
-rw-r--r--tests/test_template_parser.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/test_template_parser.py b/tests/test_template_parser.py
new file mode 100644
index 0000000..5cb6e2b
--- /dev/null
+++ b/tests/test_template_parser.py
@@ -0,0 +1,36 @@
1#!/usr/bin/env python
2from dingus import Dingus, DingusTestCase, DontCare
3import nose.tools as nose_tools
4from mrbelvedere import template_parser
5from mrbelvedere.template_parser import TemplateParser
6import yaml
7
8class WhenSettingUp(DingusTestCase(TemplateParser, exclude=['yaml'])):
9
10 def setup(self):
11 super(WhenSettingUp, self).setup()
12 self.template_parser = TemplateParser()
13
14 def should_setup_yaml(self):
15 assert isinstance(self.template_parser.yaml, type(yaml))
16
17 def should_degine_template_data_attribute(self):
18 assert self.template_parser.template_data is None
19
20 def should_define_file_attribute(self):
21 assert self.template_parser._current_template_file is None
22
23 def should_set_file_to_parse(self):
24 self.template_parser.template_file = 'examples/webserver.yaml'
25 assert self.template_parser.template_file is not None
26
27 def should_load_template(self):
28 self.template_parser.template_file = 'examples/webserver.yaml'
29 self.template_parser.load_template()
30 assert self.template_parser.template_data is not None
31
32 def should_raise_io_error(self):
33 try:
34 self.template_parser.template_file = 'examples/invalid_template.yaml'
35 except IOError:
36 assert True