• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ARMmbed / mbed-os-tools / #457

24 Aug 2024 09:15PM UTC coverage: 0.0% (-59.9%) from 59.947%
#457

push

coveralls-python

web-flow
Merge 7c6dbce13 into c467d6f14

0 of 4902 relevant lines covered (0.0%)

0.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/mbed_os_tools/test/host_tests/echo.py
1
# Copyright (c) 2018, Arm Limited and affiliates.
2
# SPDX-License-Identifier: Apache-2.0
3
#
4
# Licensed under the Apache License, Version 2.0 (the "License");
5
# you may not use this file except in compliance with the License.
6
# You may obtain a copy of the License at
7
#
8
#     http://www.apache.org/licenses/LICENSE-2.0
9
#
10
# Unless required by applicable law or agreed to in writing, software
11
# distributed under the License is distributed on an "AS IS" BASIS,
12
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
# See the License for the specific language governing permissions and
14
# limitations under the License.
15

16

17
import uuid
×
18
from .. import BaseHostTest
×
19

20
class EchoTest(BaseHostTest):
×
21

22
    __result = None
×
23
    echo_count = 0
×
24
    count = 0
×
25
    uuid_sent = []
×
26
    uuid_recv = []
×
27

28
    def __send_echo_uuid(self):
×
29
        if self.echo_count:
×
30
            str_uuid = str(uuid.uuid4())
×
31
            self.send_kv("echo", str_uuid)
×
32
            self.uuid_sent.append(str_uuid)
×
33
            self.echo_count -= 1
×
34

35
    def _callback_echo(self, key, value, timestamp):
×
36
        self.uuid_recv.append(value)
×
37
        self.__send_echo_uuid()
×
38

39
    def _callback_echo_count(self, key, value, timestamp):
×
40
        # Handshake
41
        self.echo_count = int(value)
×
42
        self.send_kv(key, value)
×
43
        # Send first echo to echo server on DUT
44
        self.__send_echo_uuid()
×
45

46
    def setup(self):
×
47
        self.register_callback("echo", self._callback_echo)
×
48
        self.register_callback("echo_count", self._callback_echo_count)
×
49

50
    def result(self):
×
51
        self.__result = self.uuid_sent == self.uuid_recv
×
52
        return self.__result
×
53

54
    def teardown(self):
×
55
        pass
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc