xref: /aosp_15_r20/external/autotest/client/site_tests/touch_HasInput/touch_HasInput.py (revision 9c5db1993ded3edbeafc8092d69fe5de2ee02df7)
1# Lint as: python2, python3
2# Copyright 2015 The Chromium OS Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6from autotest_lib.client.common_lib import error
7from autotest_lib.client.cros import touch_playback_test_base
8
9
10class touch_HasInput(touch_playback_test_base.touch_playback_test_base):
11    """Check that device has the input type specified."""
12    version = 1
13
14    def run_once(self, input_type=''):
15        """Entry point of this test.
16
17        @param input_type: a string representing the required input type.  See
18            the input_playback class for possible types.
19
20        """
21        if not input_type:
22            raise error.TestError('Please supply an input type!')
23
24        if not self.player.has(input_type):
25            raise error.TestFail('Device does not have a %s!' % input_type)
26