~canonical-platform-qa/autopilot/pdf-build

« back to all changes in this revision

Viewing changes to autopilot/tests/functional/test_input_stack.py

  • Committer: Tarmac
  • Author(s): Leo Arias, Leonardo Arias Fonseca
  • Date: 2014-10-28 03:51:00 UTC
  • mfrom: (378.1.13 fix1257059-log_move)
  • Revision ID: tarmac-20141028035100-nkaery12w84z9s01
Added the log to _uinput Mouse.move method. Fixes: https://bugs.launchpad.net/bugs/1257059.

Approved by PS Jenkins bot, Christopher Lee.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
 
21
21
import json
 
22
import logging
22
23
import os
23
24
from tempfile import mktemp
24
25
from testtools import TestCase, skipIf
28
29
from unittest import SkipTest
29
30
from unittest.mock import patch
30
31
 
 
32
from autopilot import (
 
33
    platform,
 
34
    tests
 
35
)
31
36
from autopilot.display import Display
32
 
from autopilot import platform
33
37
from autopilot.gestures import pinch
34
38
from autopilot.input import Keyboard, Mouse, Pointer, Touch
35
39
from autopilot.input._common import get_center_point
324
328
        )
325
329
 
326
330
 
327
 
class MouseTestCase(AutopilotTestCase):
 
331
class MouseTestCase(AutopilotTestCase, tests.LogHandlerTestCase):
328
332
 
329
333
    @skipIf(platform.model() != "Desktop", "Only suitable on Desktop (Mouse)")
330
334
    def test_move_to_nonint_point(self):
352
356
        self.assertThat(lambda: Mouse.create(),
353
357
                        raises(expected_exception))
354
358
 
 
359
    @skipIf(platform.model() != "Desktop", "Only suitable on Desktop (Mouse)")
 
360
    def test_mouse_move_must_log_final_position_at_debug_level(self):
 
361
        self.root_logger.setLevel(logging.DEBUG)
 
362
        mouse = Mouse.create()
 
363
        mouse.move(10, 10)
 
364
        self.assertLogLevelContains(
 
365
            'DEBUG',
 
366
            "The mouse is now at position 10,10."
 
367
        )
 
368
 
355
369
 
356
370
@skipIf(platform.model() != "Desktop", "Only suitable on Desktop (WinMocker)")
357
371
class TouchTests(AutopilotTestCase):