• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python3
2# -*- coding: utf-8 -*-
3# Copyright 2021 The Chromium OS Authors. All rights reserved.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
7# pylint: disable=module-missing-docstring,class-missing-docstring
8
9import grpc
10import unittest
11
12import callbox_server
13
14from chromiumos.test.api import callbox_service_pb2 as cbp
15from chromiumos.test.api import callbox_service_pb2_grpc as cbs
16
17
18class CallboxServerTest(unittest.TestCase):
19    def test_check_health(self):
20        server = callbox_server.serve()
21        with grpc.insecure_channel('localhost:50051') as channel:
22            client = cbs.CallboxServiceStub(channel)
23            client.CheckHealth(cbp.CheckHealthRequest())
24        server.stop(grace=1).wait()
25
26
27if __name__ == '__main__':
28    unittest.main()
29