1#!/usr/bin/env python3
2#
3# Copyright (C) 2019 The Android Open Source Project
4#
5# Licensed under the Apache License, Version 2.0 (the "License"); you may not
6# use this file except in compliance with the License. You may obtain a copy of
7# the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14# License for the specific language governing permissions and limitations under
15# the License.
16
17from acts import signals
18from acts.base_test import BaseTestClass
19from acts import asserts
20
21
22class FuchsiaLoggingTest(BaseTestClass):
23
24    def setup_class(self):
25        super().setup_class()
26        self.dut = self.fuchsia_devices[0]
27        self.message = "Logging Test"
28
29    def test_log_err(self):
30        result = self.dut.sl4f.logging_lib.logE(self.message)
31        if result.get("error") is None:
32            signals.TestPass(result.get("result"))
33        else:
34            signals.TestFailure(result.get("error"))
35
36    def test_log_info(self):
37        result = self.dut.sl4f.logging_lib.logI(self.message)
38        if result.get("error") is None:
39            signals.TestPass(result.get("result"))
40        else:
41            signals.TestFailure(result.get("error"))
42
43    def test_log_warn(self):
44        result = self.dut.sl4f.logging_lib.logW(self.message)
45        if result.get("error") is None:
46            signals.TestPass(result.get("result"))
47        else:
48            signals.TestFailure(result.get("error"))
49