aboutsummaryrefslogtreecommitdiff
path: root/modules/audio_processing/test/py_quality_assessment/apm_quality_assessment_unittest.py
blob: f5240f86965234cbe11c463e928fbbe7a912157f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS.  All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.

"""Unit tests for the apm_quality_assessment module.
"""

import os
import sys
import unittest

SRC = os.path.abspath(os.path.join(
    os.path.dirname((__file__)), os.pardir, os.pardir, os.pardir))
sys.path.append(os.path.join(SRC, 'third_party', 'pymock'))

import mock

import apm_quality_assessment

class TestSimulationScript(unittest.TestCase):
  """Unit tests for the apm_quality_assessment module.
  """

  def testMain(self):
    # Exit with error code if no arguments are passed.
    with self.assertRaises(SystemExit) as cm, mock.patch.object(
        sys, 'argv', ['apm_quality_assessment.py']):
      apm_quality_assessment.main()
    self.assertGreater(cm.exception.code, 0)