• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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    def setup_class(self):
24        super().setup_class()
25        self.dut = self.fuchsia_devices[0]
26        self.message = "Logging Test"
27
28    def test_log_err(self):
29        result = self.dut.logging_lib.logE(self.message)
30        if result.get("error") is None:
31            signals.TestPass(result.get("result"))
32        else:
33            signals.TestFailure(result.get("error"))
34
35    def test_log_info(self):
36        result = self.dut.logging_lib.logI(self.message)
37        if result.get("error") is None:
38            signals.TestPass(result.get("result"))
39        else:
40            signals.TestFailure(result.get("error"))
41
42    def test_log_warn(self):
43        result = self.dut.logging_lib.logW(self.message)
44        if result.get("error") is None:
45            signals.TestPass(result.get("result"))
46        else:
47            signals.TestFailure(result.get("error"))
48