Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(746)

Unified Diff: webrtc/modules/audio_processing/test/py_quality_assessment/apm_quality_assessment_unittest.py

Issue 2989823002: Input signal creation for non-existing input signal files (Closed)
Patch Set: merge Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/test/py_quality_assessment/apm_quality_assessment_unittest.py
diff --git a/webrtc/modules/audio_processing/test/py_quality_assessment/apm_quality_assessment_unittest.py b/webrtc/modules/audio_processing/test/py_quality_assessment/apm_quality_assessment_unittest.py
index dd0eb073830f7f5207955586702c2e0b928fafee..f5240f86965234cbe11c463e928fbbe7a912157f 100644
--- a/webrtc/modules/audio_processing/test/py_quality_assessment/apm_quality_assessment_unittest.py
+++ b/webrtc/modules/audio_processing/test/py_quality_assessment/apm_quality_assessment_unittest.py
@@ -9,8 +9,16 @@
"""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):
@@ -19,6 +27,7 @@ class TestSimulationScript(unittest.TestCase):
def testMain(self):
# Exit with error code if no arguments are passed.
- with self.assertRaises(SystemExit) as cm:
+ 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)

Powered by Google App Engine
This is Rietveld 408576698