1 # Copyright (c) 2020 Project CHIP Authors
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 from chip_mobly import pigweed_device
16 from mobly import asserts # type: ignore
17 from mobly import base_test
18 from mobly import test_runner
21 class HelloWorldTest(base_test.BaseTestClass):
22 def setup_class(self):
23 # Registering pigweed_device controller module declares the test's
24 # dependency on CHIP/Pigweed device hardware. By default, we expect at least one
25 # object is created from this.
26 # Assumes correct image is already flashed.
27 self.ads = self.register_controller(pigweed_device)
28 self.dut = self.ads[0]
32 status, payload = self.dut.rpcs().EchoService.Echo(msg=expected)
33 asserts.assert_true(status.ok(), "Status is %s" % status)
37 'Returned payload is "%s" expected "%s"' % (payload.msg, expected),
41 if __name__ == "__main__":