summaryrefslogtreecommitdiff
path: root/tests/test_emitter.py
diff options
context:
space:
mode:
authorxi <xi@18f92427-320e-0410-9341-c67f048884a3>2006-03-20 23:31:07 +0000
committerxi <xi@18f92427-320e-0410-9341-c67f048884a3>2006-03-20 23:31:07 +0000
commit066042294c0843c568addf69db0ea58c3abda162 (patch)
tree917b110d971df5d669197fb070eb1099a9c5fbb9 /tests/test_emitter.py
parent04cc6bab4adff87f260cc7611df36af5b5804d07 (diff)
downloadpyyaml-066042294c0843c568addf69db0ea58c3abda162.tar.gz
Add a skeleton of the emitter.
git-svn-id: http://svn.pyyaml.org/pyyaml/branches/working-on-emitter@122 18f92427-320e-0410-9341-c67f048884a3
Diffstat (limited to 'tests/test_emitter.py')
-rw-r--r--tests/test_emitter.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_emitter.py b/tests/test_emitter.py
new file mode 100644
index 0000000..1ff0ecc
--- /dev/null
+++ b/tests/test_emitter.py
@@ -0,0 +1,19 @@
+
+import test_appliance, sys
+
+from yaml import *
+
+class TestEmitterOnCanonical(test_appliance.TestAppliance):
+
+ def _testEmitterOnCanonical(self, test_name, canonical_filename):
+ events = list(iter(Parser(Scanner(Reader(file(canonical_filename, 'rb'))))))
+ writer = sys.stdout
+ emitter = Emitter(writer)
+ print "-"*30
+ print "ORIGINAL DATA:"
+ print file(canonical_filename, 'rb').read()
+ for event in events:
+ emitter.emit(event)
+
+TestEmitterOnCanonical.add_tests('testEmitterOnCanonical', '.canonical')
+