Beispiel #1
0
import mock

import openhtf as htf
from openhtf import util
from examples import all_the_things
from openhtf.output.callbacks import mfg_inspector
from openhtf.output.proto import guzzle_pb2
from openhtf.output.proto import test_runs_converter
from openhtf.output.proto import test_runs_pb2
from openhtf.util import test

MOCK_TEST_RUN_PROTO = test_runs_pb2.TestRun(
    tester_name='mock_test_run',
    dut_serial='UNITTEST1234',
    test_status=test_runs_pb2.PASS,
    test_info=test_runs_pb2.TestInfo(name='unit_test'))

MOCK_TEST_RUN = collections.namedtuple('Testrun',
                                       mfg_inspector.MfgInspector.PARAMS)(None,
                                                                          None,
                                                                          None,
                                                                          None)


class TestMfgInspector(test.TestCase):

  def setUp(self):
    super(TestMfgInspector, self).setUp()
    self.mock_credentials = mock.patch(
        'oauth2client.client.SignedJwtAssertionCredentials').start(
        ).return_value
from unittest import mock

import openhtf as htf
from openhtf import util
from examples import all_the_things
from openhtf.output.callbacks import mfg_inspector
from openhtf.output.proto import guzzle_pb2
from openhtf.output.proto import test_runs_converter
from openhtf.output.proto import test_runs_pb2
from openhtf.util import test

MOCK_TEST_RUN_PROTO = test_runs_pb2.TestRun(  # pytype: disable=module-attr  # gen-stub-imports
    tester_name='mock_test_run',
    dut_serial='UNITTEST1234',
    test_status=test_runs_pb2.PASS,
    test_info=test_runs_pb2.TestInfo(name='unit_test'))  # pytype: disable=module-attr  # gen-stub-imports

MOCK_TEST_RUN = collections.namedtuple('Testrun',
                                       mfg_inspector.MfgInspector.PARAMS)(None,
                                                                          None,
                                                                          None,
                                                                          None)


class TestMfgInspector(test.TestCase):
    def setUp(self):
        super(TestMfgInspector, self).setUp()
        self.mock_credentials = mock.patch(
            'oauth2client.client.SignedJwtAssertionCredentials').start(
            ).return_value