Fix the dialer_test_import_address test Test: https://paste.googleplex.com/5368644953964544(locally) Bug: 323048143 Change-Id: I8b00dec2f512b5d903087bfb9f2d985f78eee807
diff --git a/tests/automotive/mobly_tests/dialer/dialer_test_import_address_details.py b/tests/automotive/mobly_tests/dialer/dialer_test_import_address_details.py index ae03642..72aa550 100644 --- a/tests/automotive/mobly_tests/dialer/dialer_test_import_address_details.py +++ b/tests/automotive/mobly_tests/dialer/dialer_test_import_address_details.py
@@ -24,7 +24,7 @@ import logging from mobly import asserts -from mobly import base_test +from bluetooth_test import bluetooth_base_test from mobly.controllers import android_device from utilities.main_utils import common_main @@ -33,29 +33,9 @@ from utilities import bt_utils -class ImportAddressDetailsTest(base_test.BaseTestClass): +class ImportAddressDetailsTest(bluetooth_base_test.BluetoothBaseTest): VCF_ADDRESS_HEADER = "ADR" - def setup_class(self): - # Registering android_device controller module, and declaring that the test - # requires at least two Android devices. - self.ads = self.register_controller(android_device, min_number=2) - # # The device used to discover Bluetooth devices. - self.discoverer = android_device.get_device( - self.ads, label='auto') - # # Sets the tag that represents this device in logs. - self.discoverer.debug_tag = 'discoverer' - # # The device that is expected to be discovered - self.target = android_device.get_device(self.ads, label='phone') - self.target.debug_tag = 'target' - # - self.target.load_snippet('mbs', android_device.MBS_PACKAGE) - self.discoverer.load_snippet('mbs', android_device.MBS_PACKAGE) - # - self.call_utils = (spectatio_utils.CallUtils(self.discoverer)) - # - self.bt_utils = (bt_utils.BTUtils(self.discoverer, self.target)) - def get_first_address(self, vcf_path): """ Reads the first address from the given vcf file'""" @@ -65,7 +45,6 @@ return line - def setup_test(self): # Upload contacts to phone device file_path = constants.PATH_TO_CONTACTS_VCF_FILE @@ -98,8 +77,7 @@ def teardown_test(self): # Turn Bluetooth off on both devices after test finishes. - self.target.mbs.btDisable() - self.discoverer.mbs.btDisable() + super().teardown_test() def compare_display_address_to_vcf_line(self, display_address, vcf_address): """Confirm that each portion of a display-able street address appears in the vcf line.
diff --git a/tests/automotive/mobly_tests/utilities/constants.py b/tests/automotive/mobly_tests/utilities/constants.py index be31b6b..3a5fcb9 100644 --- a/tests/automotive/mobly_tests/utilities/constants.py +++ b/tests/automotive/mobly_tests/utilities/constants.py
@@ -58,7 +58,6 @@ + PHONE_CONTACTS_DESTINATION_PATH + ' -a android.intent.action.VIEW com.google.android.contacts' ) -PATH_TO_CONTACTS_VCF_FILE = 'platform_testing/tests/automotive/mobly_tests/utils/contacts_test.vcf' # Should be kept in sync with BluetoothProfile.java BT_PROFILE_CONSTANTS = {