Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a25f2567 authored by William Escande's avatar William Escande
Browse files

Add a pre-test mmi to get the pts address

Some HFP test need to start waiting for a connection BEFORE the test
start and we need the address to wait for it

Bug: 237447510
Test: atest pts-bot
Change-Id: I3df66abb2c5a99f14459beee93e7784fdc6caf19
parent d21ffe3a
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -11,18 +11,18 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Profile proxy base module."""

from mmi2grpc._helpers import format_function
from mmi2grpc._helpers import assert_description

import sys


class ProfileProxy:
    """Profile proxy base class."""

    def interact(
            self, test: str, mmi_name: str, mmi_description: str,
            pts_addr: bytes):
    def interact(self, test: str, mmi_name: str, mmi_description: str, pts_addr: bytes):
        """Translate a MMI call to its corresponding implementation.

        Args:
@@ -37,8 +37,10 @@ class ProfileProxy:
        try:
            if not mmi_name.isidentifier():
                mmi_name = "_mmi_" + mmi_name
            return getattr(self, mmi_name)(
                test=test, description=mmi_description, pts_addr=pts_addr)
            return getattr(self, mmi_name)(test=test, description=mmi_description, pts_addr=pts_addr)
        except AttributeError:
            code = format_function(mmi_name, mmi_description)
            assert False, f'Unhandled mmi {id}\n{code}'

    def test_started(self, test: str, description: str, pts_addr: bytes):
        return "OK"