~ubuntu-branches/ubuntu/vivid/ibus-cangjie/vivid

« back to all changes in this revision

Viewing changes to tests/test_cangjie.py

  • Committer: Package Import Robot
  • Author(s): Anthony Wong
  • Date: 2014-01-06 02:57:07 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20140106025707-apljclew3144ijwh
Tags: 2.0-1
* New upstream release.
* Update debian/watch to use new upstream URL.
* Depends python3-pycangjie (>= 1.0)

Show diffs side-by-side

added added

removed removed

Lines of Context:
249
249
        self.assertEqual(len(self.engine._mock_auxiliary_text), 1)
250
250
        self.assertEqual(len(self.engine._mock_committed_text), 0)
251
251
        self.assertEqual(self.engine.lookuptable.get_number_of_candidates(), 0)
 
252
 
 
253
    def test_symbol(self):
 
254
        self.engine.do_process_key_event(IBus.at, 0, 0)
 
255
 
 
256
        self.assertEqual(len(self.engine._mock_auxiliary_text), 0)
 
257
        self.assertEqual(len(self.engine._mock_committed_text), 1)
 
258
        self.assertEqual(self.engine.lookuptable.get_number_of_candidates(), 0)
 
259
 
 
260
    def test_multiple_punctuation(self):
 
261
        self.engine.do_process_key_event(IBus.comma, 0, 0)
 
262
 
 
263
        self.assertEqual(len(self.engine._mock_auxiliary_text), 1)
 
264
        self.assertEqual(len(self.engine._mock_committed_text), 0)
 
265
        self.assertTrue(self.engine.lookuptable.get_number_of_candidates() > 1)
 
266
 
 
267
    def test_char_then_multiple_punctuation(self):
 
268
        self.engine.do_process_key_event(IBus.d, 0, 0)
 
269
        self.engine.do_process_key_event(IBus.comma, 0, 0)
 
270
 
 
271
        self.assertEqual(len(self.engine._mock_auxiliary_text), 1)
 
272
        self.assertEqual(len(self.engine._mock_committed_text), 1)
 
273
        self.assertTrue(self.engine.lookuptable.get_number_of_candidates() > 1)
 
274
 
 
275
    def test_punctuation_then_punctuation(self):
 
276
        self.engine.do_process_key_event(IBus.comma, 0, 0)
 
277
        self.engine.do_process_key_event(IBus.comma, 0, 0)