/usr/lib/python3/dist-packages/checkbox_support/scripts/tests/test_audio_settings.py is in python3-checkbox-support 0.22-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | #
# This file is part of Checkbox.
#
# Copyright 2013 Canonical Ltd.
#
# Checkbox is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3,
# as published by the Free Software Foundation.
#
# Checkbox is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Checkbox. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import unittest
from checkbox_support.scripts.audio_settings import _guess_hdmi_profile
from checkbox_support.parsers.tests.test_pactl import PactlDataMixIn
class SetProfileTest(unittest.TestCase, PactlDataMixIn):
def test_desktop_precise_xps1340(self):
"""
Precise system with a Nvidia chipset.
HDMI is present in the card ports list but not shown in the sinks list.
The port availability cannot be determined, in that case the expected
value is the first stereo profile listed in the identified port.
Meaningful lines:
Card #0
[...]
Ports:
[...]
hdmi-output-0: HDMI / DisplayPort (priority 5900)
Part of profile(s): output:hdmi-stereo, output:hdmi-stereo+input:analog-stereo, output:hdmi-surround, output:hdmi-surround+input:analog-stereo
"""
self.assertEqual(
_guess_hdmi_profile(self.get_text("desktop-precise-xps1340")),
('0', 'output:hdmi-stereo'))
def test_desktop_precise_radeon_not_available(self):
"""
Home-made system running Precise with a Radeon card.
HDMI is present in the card ports list and shown in the sinks list.
But the port is "not available", both card and profile should be set
to None.
Meaningful lines:
Sink #0
[...]
Ports:
hdmi-output-0: HDMI / DisplayPort (priority: 5900, not available)
[...]
Card #0
[...]
Ports:
hdmi-output-0: HDMI / DisplayPort (priority 5900)
Part of profile(s): output:hdmi-stereo
"""
self.assertEqual(
_guess_hdmi_profile(self.get_text("desktop-precise-radeon")),
(None, None))
def test_desktop_precise_radeon_available(self):
"""
Home-made system running Precise with a Radeon card.
HDMI is present in the card ports list, shown in the sinks list and
marked as "available", in that case the expected value is the first
stereo profile listed in the identified port.
Meaningful lines:
Sink #0
[...]
Ports:
hdmi-output-0: HDMI / DisplayPort (priority: 5900, available)
[...]
Card #0
[...]
Ports:
hdmi-output-0: HDMI / DisplayPort (priority 5900)
Part of profile(s): output:hdmi-stereo
"""
self.assertEqual(
_guess_hdmi_profile(self.get_text(
"desktop-precise-radeon-hdmi-available")),
('0', 'output:hdmi-stereo'))
def test_desktop_raring_t430s_not_available(self):
"""
Raring system with a Mini-DisplayPort.
DisplayPort is present in the card ports list but marked as
"not available". Thus both card and profile should be set
to None.
Meaningful lines:
Card #2
[...]
Ports:
[...]
hdmi-output-0: HDMI / DisplayPort (priority: 5900, latency offset: 0 usec, not available)
Properties:
device.icon_name = "video-display"
Part of profile(s): output:hdmi-stereo, output:hdmi-stereo+input:analog-stereo
hdmi-output-1: HDMI / DisplayPort 2 (priority: 5800, latency offset: 0 usec, not available)
Properties:
device.icon_name = "video-display"
Part of profile(s): output:hdmi-stereo-extra1, output:hdmi-stereo-extra1+input:analog-stereo, output:hdmi-surround-extra1, output:hdmi-surround-extra1+input:analog-stereo
hdmi-output-2: HDMI / DisplayPort 3 (priority: 5700, latency offset: 0 usec, not available)
Properties:
device.icon_name = "video-display"
Part of profile(s): output:hdmi-stereo-extra2, output:hdmi-stereo-extra2+input:analog-stereo, output:hdmi-surround-extra2, output:hdmi-surround-extra2+input:analog-stereo
"""
self.assertEqual(
_guess_hdmi_profile(self.get_text("desktop-raring-t430s")),
(None, None))
def test_desktop_raring_t430s_available(self):
"""
Raring system with a Mini-DisplayPort.
DisplayPort is present in the card ports list and marked as
"available", in that case the expected value is the first stereo
profile listed in the identified port.
Meaningful lines:
Card #2
[...]
Ports:
[...]
hdmi-output-0: HDMI / DisplayPort (priority: 5900, latency offset: 0 usec, available)
Properties:
device.icon_name = "video-display"
Part of profile(s): output:hdmi-stereo, output:hdmi-stereo+input:analog-stereo
hdmi-output-1: HDMI / DisplayPort 2 (priority: 5800, latency offset: 0 usec, not available)
Properties:
device.icon_name = "video-display"
Part of profile(s): output:hdmi-stereo-extra1, output:hdmi-stereo-extra1+input:analog-stereo, output:hdmi-surround-extra1, output:hdmi-surround-extra1+input:analog-stereo
hdmi-output-2: HDMI / DisplayPort 3 (priority: 5700, latency offset: 0 usec, not available)
Properties:
device.icon_name = "video-display"
Part of profile(s): output:hdmi-stereo-extra2, output:hdmi-stereo-extra2+input:analog-stereo, output:hdmi-surround-extra2, output:hdmi-surround-extra2+input:analog-stereo
"""
self.assertEqual(
_guess_hdmi_profile(self.get_text(
"desktop-raring-t430s-dp-available")),
('2', 'output:hdmi-stereo'))
|