Use yaml.safe_dump instead of yaml.dump

After changing to use yaml.safe_load, some of the tests are failing
locally with unicode error. Though we've not noticed these issues
at the gate, it's better to use safe_dump to avoid them.

Change-Id: I84cf921afe76b3bed44e84230a71b244bb886cce
Closes-Bug: #1547399
diff --git a/functional/test_default_parameters.py b/functional/test_default_parameters.py
index a33823f..7201969 100644
--- a/functional/test_default_parameters.py
+++ b/functional/test_default_parameters.py
@@ -77,7 +77,7 @@
             # remove the default from the parameter in the nested template.
             ntempl = yaml.safe_load(self.nested_template)
             del ntempl['parameters']['length']['default']
-            nested_template = yaml.dump(ntempl)
+            nested_template = yaml.safe_dump(ntempl)
         else:
             nested_template = self.nested_template
 
diff --git a/functional/test_hooks.py b/functional/test_hooks.py
index d9ebd44..bafb0ef 100644
--- a/functional/test_hooks.py
+++ b/functional/test_hooks.py
@@ -191,7 +191,7 @@
                          res_after.physical_resource_id)
 
     def test_hook_pre_create_nested(self):
-        files = {'nested.yaml': yaml.dump(self.template)}
+        files = {'nested.yaml': yaml.safe_dump(self.template)}
         env = {'resource_registry':
                {'resources':
                 {'nested':