Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: client/dom/scripts/multiemitter_test.py

Issue 9845043: Rename client/{dom,html} to lib/{dom,html} . (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « client/dom/scripts/multiemitter.py ('k') | client/dom/scripts/pegparser.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/python
2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file.
5
6 """Tests for emitter module."""
7
8 import logging.config
9 import unittest
10 import emitter
11 import multiemitter
12
13
14 class MultiEmitterTestCase(unittest.TestCase):
15
16 def setUp(self):
17 pass
18
19 def tearDown(self):
20 pass
21
22 def check(self, m, expected):
23 """Verifies that the multiemitter contains the expected contents.
24
25 Expected is a list of (filename, content) pairs, sorted by filename.
26 """
27 files = []
28 def _Collect(file, contents):
29 files.append((file, ''.join(contents)))
30 m.Flush(_Collect)
31 self.assertEquals(expected, files)
32
33 def testExample(self):
34 m = multiemitter.MultiEmitter()
35 e1 = m.FileEmitter('file1')
36 e2 = m.FileEmitter('file2', 'key2')
37 e1.Emit('Hi 1')
38 e2.Emit('Hi 2')
39 m.Find('key2').Emit('Bye 2')
40 self.check(m,
41 [('file1', 'Hi 1'),
42 ('file2', 'Hi 2Bye 2') ])
43
44 if __name__ == '__main__':
45 logging.config.fileConfig('logging.conf')
46 if __name__ == '__main__':
47 unittest.main()
OLDNEW
« no previous file with comments | « client/dom/scripts/multiemitter.py ('k') | client/dom/scripts/pegparser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698