/external/autotest/site_utils/autoupdate/ |
D | full_release_test_test.py | 9 import mox 75 class FullReleaseTestTests(mox.MoxTestBase): 81 mox.MoxTestBase.setUp(self) 82 self.mox.StubOutWithMock(gsutil_util, 'GSUtilRun') 88 mox.MoxTestBase.tearDown(self) 105 gsutil_util.GSUtilRun(mox.And( 106 mox.StrContains('gsutil cat'), 107 mox.StrContains('%s/UPLOADED' % target)), mox.IgnoreArg()).\ 111 gsutil_util.GSUtilRun(mox.And( 112 mox.StrContains('gsutil cat'), [all …]
|
/external/autotest/client/common_lib/cros/ |
D | autoupdater_unittest.py | 6 import mox 14 class TestAutoUpdater(mox.MoxTestBase): 40 update_url, host=self.mox.CreateMockAnything()) 42 self.mox.UnsetStubs() 43 self.mox.StubOutWithMock(updater.host, 'get_release_version') 46 self.mox.ReplayAll() 51 self.mox.UnsetStubs() 52 self.mox.StubOutWithMock(updater.host, 'get_release_version') 55 self.mox.ReplayAll() 60 self.mox.UnsetStubs() [all …]
|
D | dev_server_unittest.py | 10 import mox 39 class DevServerTest(mox.MoxTestBase): 56 self.mox.StubOutWithMock(urllib2, 'urlopen') 63 self.mox.StubOutWithMock(dev_server, '_get_dev_server_list') 64 self.mox.StubOutWithMock(dev_server.DevServer, 'devserver_healthy') 69 self.mox.ReplayAll() 76 self.mox.StubOutWithMock(dev_server, '_get_dev_server_list') 82 urllib2.urlopen(mox.StrContains(bad_host), data=None).AndRaise( 86 urllib2.urlopen(mox.StrContains(good_host), 89 self.mox.ReplayAll() [all …]
|
D | retry_unittest.py | 9 import mox 19 class RetryTest(mox.MoxTestBase): 38 self.mox.StubOutWithMock(time, 'sleep') 39 self.mox.ReplayAll() 53 self.mox.StubOutWithMock(time, 'sleep') 54 time.sleep(mox.Func(lambda x: abs(x - delay_sec) <= .5 * delay_sec)) 55 self.mox.ReplayAll() 66 self.mox.StubOutWithMock(time, 'sleep') 67 time.sleep(mox.Func(lambda x: abs(x - delay_sec) <= .5 * delay_sec)) 68 self.mox.ReplayAll() [all …]
|
/external/autotest/frontend/health/ |
D | check_test_health_unittest.py | 7 import logging, mox, subprocess, unittest 14 class RunPrepScriptsTests(mox.MoxTestBase): 19 self.mox.StubOutWithMock(subprocess, 'call') 20 self.mox.StubOutWithMock(logging, 'error') 21 self.mox.StubOutWithMock(logging, 'info') 28 logging.info(mox.IgnoreArg(), mox.IgnoreArg()) 30 logging.info(mox.IgnoreArg(), mox.IgnoreArg()) 33 self.mox.ReplayAll() 41 logging.info(mox.IgnoreArg(), mox.IgnoreArg()) 42 subprocess.call(mox.IgnoreArg()).AndReturn(0) [all …]
|
/external/autotest/site_utils/ |
D | test_push_unittest.py | 7 import mox 21 class TestPushUnittests(mox.MoxTestBase): 41 self.mox.UnsetStubs() 43 self.mox.StubOutWithMock(urllib2, 'urlopen') 44 urllib2.urlopen(mox.IgnoreArg()).AndReturn(response) 46 self.mox.StubOutWithMock(test_push, 'get_default_build') 47 test_push.get_default_build(mox.IgnoreArg(), mox.IgnoreArg()).AndReturn( 49 test_push.get_default_build(mox.IgnoreArg(), mox.IgnoreArg()).AndReturn( 52 self.mox.StubOutWithMock(test_push, 'check_dut_image') 53 test_push.check_dut_image(mox.IgnoreArg(), mox.IgnoreArg()).AndReturn( [all …]
|
D | server_manager_unittest.py | 5 import mox 43 class ServerManagerUnittests(mox.MoxTestBase): 52 self.DRONE_ROLE = mox.MockObject( 55 self.SCHEDULER_ROLE = mox.MockObject( 58 self.DRONE_ATTRIBUTE = mox.MockObject( 61 self.PRIMARY_DRONE = mox.MockObject( 67 self.BACKUP_DRONE = mox.MockObject( 73 self.PRIMARY_SCHEDULER = mox.MockObject( 79 self.BACKUP_SCHEDULER = mox.MockObject( 86 self.mox.StubOutWithMock(server_manager_utils, 'check_server') [all …]
|
D | test_runner_utils_unittest.py | 8 import mox 17 class StartsWithList(mox.Comparator): 34 class ContainsSublist(mox.Comparator): 82 self.mox = mox.Mox() 105 mock_process_1 = self.mox.CreateMock(subprocess.Popen) 106 mock_process_2 = self.mox.CreateMock(subprocess.Popen) 107 fake_stdout = self.mox.CreateMock(file) 114 self.mox.StubOutWithMock(os, 'makedirs') 115 self.mox.StubOutWithMock(utils, 'write_keyval') 116 self.mox.StubOutWithMock(subprocess, 'Popen') [all …]
|
/external/chromium-trace/catapult/telemetry/third_party/mox3/mox3/tests/ |
D | test_mox.py | 24 from mox3 import mox 38 self.assertRaises(ValueError, mox.ExpectedMethodCallsError, []) 41 method = mox.MockMethod("testMethod", [], False) 43 e = mox.ExpectedMethodCallsError([method]) 50 method1 = mox.MockMethod("testMethod", [], False) 52 method2 = mox.MockMethod("testMethod", [], False) 54 method3 = mox.MockMethod("testMethod2", [], False) 56 method4 = mox.MockMethod("testMethod", [], False) 58 e = mox.ExpectedMethodCallsError([method1, method2, method3, method4]) 73 self.assertTrue(mox.Or(mox.IsA(dict), mox.IsA(str)) == {}) [all …]
|
/external/chromium-trace/catapult/third_party/mox3/mox3/tests/ |
D | test_mox.py | 24 from mox3 import mox 38 self.assertRaises(ValueError, mox.ExpectedMethodCallsError, []) 41 method = mox.MockMethod("testMethod", [], False) 43 e = mox.ExpectedMethodCallsError([method]) 50 method1 = mox.MockMethod("testMethod", [], False) 52 method2 = mox.MockMethod("testMethod", [], False) 54 method3 = mox.MockMethod("testMethod2", [], False) 56 method4 = mox.MockMethod("testMethod", [], False) 58 e = mox.ExpectedMethodCallsError([method1, method2, method3, method4]) 73 self.assertTrue(mox.Or(mox.IsA(dict), mox.IsA(str)) == {}) [all …]
|
/external/autotest/site_utils/rpm_control_system/ |
D | rpm_controller_unittest.py | 6 import mox 18 class TestRPMControllerQueue(mox.MoxTestBase): 36 process = self.mox.CreateMockAnything() 37 rpm_controller.multiprocessing.Process = self.mox.CreateMockAnything() 38 rpm_controller.multiprocessing.Process(target=mox.IgnoreArg(), 39 args=mox.IgnoreArg()).AndReturn(process) 42 self.mox.ReplayAll() 44 self.mox.VerifyAll() 47 class TestSentryRPMController(mox.MoxTestBase): 53 self.ssh = self.mox.CreateMockAnything() [all …]
|
D | utils_unittest.py | 7 import mox 16 class TestUtils(mox.MoxTestBase): 22 self.mox.StubOutWithMock(__builtin__, 'open') 28 fake_file = self.mox.CreateMockAnything() 30 fake_file.__exit__(mox.IgnoreArg(), mox.IgnoreArg(), mox.IgnoreArg()) 38 self.mox.ReplayAll() 41 self.mox.VerifyAll() 46 self.mox.StubOutWithMock(utils, 'load_servo_interface_mapping') 47 self.mox.StubOutWithMock(os.path, 'getmtime') 56 os.path.getmtime(mox.IgnoreArg()).AndReturn(last_modified) [all …]
|
/external/autotest/server/cros/dynamic_suite/ |
D | job_status_unittest.py | 11 import mox 30 class StatusTest(mox.MoxTestBase): 37 self.afe = self.mox.CreateMock(frontend.AFE) 38 self.tko = self.mox.CreateMock(frontend.TKO) 55 self.mox.ReplayAll() 70 self.mox.ReplayAll() 85 self.mox.ReplayAll() 93 self.mox.StubOutWithMock(time, 'sleep') 98 time.sleep(mox.IgnoreArg()).MultipleTimes() 99 self.mox.ReplayAll() [all …]
|
D | reporting_unittest.py | 9 import mox 21 class ReportingTest(mox.MoxTestBase): 76 self.mox.StubOutClassWithMocks(phapi_lib, 'ProjectHostingApiClient') 95 self.mox.StubOutWithMock(reporting.Reporter, 'find_issue_by_marker') 96 self.mox.StubOutWithMock(reporting.TestBug, 'summary') 98 client = phapi_lib.ProjectHostingApiClient(mox.IgnoreArg(), 99 mox.IgnoreArg()) 100 client.create_issue(mox.IgnoreArg()).AndReturn( 102 reporting.Reporter.find_issue_by_marker(mox.IgnoreArg()).AndReturn( 106 self.mox.ReplayAll() [all …]
|
D | suite_unittest.py | 11 import mox 37 class SuiteTest(mox.MoxTestBase): 56 self.afe = self.mox.CreateMock(frontend.AFE) 57 self.tko = self.mox.CreateMock(frontend.TKO) 61 self.getter = self.mox.CreateMock(control_file_getter.ControlFileGetter) 114 self.mox.StubOutWithMock(control_data, 'parse_control_string') 128 self.mox.ReplayAll() 154 self.mox.ReplayAll() 173 self.mox.ReplayAll() 193 self.mox.ReplayAll() [all …]
|
D | comparators.py | 7 import mox 9 class StatusContains(mox.Comparator): 12 status_comp = mox.StrContains(status) if status else mox.IgnoreArg() 13 name_comp = mox.StrContains(test_name) if test_name else mox.IgnoreArg() 14 reason_comp = mox.StrContains(reason) if reason else mox.IgnoreArg() 18 def __init__(self, status=mox.IgnoreArg(), test_name=mox.IgnoreArg(), 19 reason=mox.IgnoreArg()): 51 class InHostList(mox.Comparator): 66 class AllInHostList(mox.Comparator):
|
/external/autotest/site_utils/suite_scheduler/ |
D | base_event_unittest.py | 10 import mox 29 multiple_labels=mox.IgnoreArg()).AndReturn(['host1']) 34 self.Run(mox.IgnoreArg(), 35 mox.IgnoreArg(), 36 mox.IgnoreArg(), 37 mox.IgnoreArg(), 38 mox.IgnoreArg()).InAnyOrder('tasks').AndReturn(True) 49 self.Run(mox.IgnoreArg(), 50 mox.IgnoreArg(), 51 mox.IgnoreArg(), [all …]
|
D | manifest_versions_unittest.py | 18 import mox 26 class ManifestVersionsTest(mox.MoxTestBase): 75 self.mox.StubOutWithMock(self.mv, '_Clone') 76 self.mox.StubOutWithMock(time, 'sleep') 78 self.mox.ReplayAll() 84 self.mox.StubOutWithMock(self.mv, '_Clone') 85 self.mox.StubOutWithMock(time, 'sleep') 92 self.mox.ReplayAll() 98 self.mox.StubOutWithMock(self.mv, '_Clone') 99 self.mox.StubOutWithMock(time, 'sleep') [all …]
|
D | timed_event_unittest.py | 9 import collections, datetime, mox, unittest 17 class TimedEventTestBase(mox.MoxTestBase): 23 self.mox.StubOutWithMock(timed_event.TimedEvent, '_now') 24 self.mv = self.mox.CreateMock(manifest_versions.ManifestVersions) 50 self.mox.ReplayAll() 54 self.mox.VerifyAll() 56 self.mox.ResetAll() 59 self.mox.ReplayAll() 66 self.mox.ReplayAll() 77 self.mox.ReplayAll() [all …]
|
D | deduping_scheduler_unittest.py | 9 import mox 23 class DedupingSchedulerTest(mox.MoxTestBase): 44 self.afe = self.mox.CreateMock(frontend.AFE) 46 self.mox.StubOutWithMock(site_utils, 'check_lab_status') 73 created_on__gte=mox.IgnoreArg()).AndReturn([]) 88 self.mox.ReplayAll() 106 created_on__gte=mox.IgnoreArg()).AndReturn(['42']) 107 self.mox.ReplayAll() 121 self.mox.ReplayAll() 147 self.mox.ReplayAll() [all …]
|
/external/autotest/server/ |
D | lab_status_unittest.py | 7 import mox 107 class GetStatusTest(mox.MoxTestBase): 119 self.mox.StubOutWithMock(urllib2, 'urlopen') 120 self.mox.StubOutWithMock(time, 'sleep') 127 urllib2.urlopen(mox.IgnoreArg()).AndReturn( 129 self.mox.ReplayAll() 131 self.mox.VerifyAll() 139 urllib2.urlopen(mox.IgnoreArg()).AndRaise( 141 time.sleep(mox.IgnoreArg()).AndReturn(None) 142 urllib2.urlopen(mox.IgnoreArg()).AndReturn( [all …]
|
/external/autotest/frontend/afe/ |
D | site_rpc_interface_unittest.py | 12 import mox 37 class SiteRpcInterfaceTest(mox.MoxTestBase, 57 self.dev_server = self.mox.CreateMock(dev_server.ImageServer) 66 self.mox.StubOutClassWithMocks(dev_server, 'ImageServer') 73 self.getter = self.mox.CreateMock( 75 self.mox.StubOutWithMock(control_file_getter.DevServerGetter, 78 mox.IgnoreArg(), mox.IgnoreArg()).AndReturn(self.getter) 93 self.mox.StubOutWithMock(rpc_utils, 'create_job_common') 94 rpc_utils.create_job_common(mox.And(mox.StrContains(self._NAME), 95 mox.StrContains(self._BUILD)), [all …]
|
/external/autotest/client/cros/cellular/wardmodem/state_machines/ |
D | request_response_unittest.py | 11 import mox 24 self._mox = mox.Mox() 55 self._task_loop.post_task_after_delay(mox.IgnoreArg(), 59 self._task_loop.post_task_after_delay(mox.IgnoreArg(), 63 self._task_loop.post_task_after_delay(mox.IgnoreArg(), 67 self._task_loop.post_task_after_delay(mox.IgnoreArg(), 71 self._task_loop.post_task_after_delay(mox.IgnoreArg(), 75 self._task_loop.post_task_after_delay(mox.IgnoreArg(), 79 self._task_loop.post_task_after_delay(mox.IgnoreArg(), 82 self._task_loop.post_task_after_delay(mox.IgnoreArg(), [all …]
|
/external/chromium-trace/catapult/third_party/closure_linter/closure_linter/ |
D | runner_test.py | 23 import mox 50 self.mox = mox.Mox() 53 mock_error_handler = self.mox.CreateMock(errorhandler.ErrorHandler) 61 mock_error_handler.HandleError(mox.Func(ValidateError)) 64 self.mox.ReplayAll() 68 self.mox.VerifyAll() 71 mock_error_handler = self.mox.CreateMock(errorhandler.ErrorHandler) 78 mock_error_handler.HandleFile('foo.js', mox.IsA(tokens.Token)) 79 mock_error_handler.HandleError(mox.Func(ValidateError)) 80 mock_error_handler.HandleError(mox.IsA(error.Error)) [all …]
|
/external/autotest/client/common_lib/cros/fake_device_server/ |
D | resource_method_unittest.py | 9 import mox 19 class ResourceMethodTest(mox.MoxTestBase): 24 mox.MoxTestBase.setUp(self) 36 self.mox.StubOutWithMock(common_util, 'parse_serialized_json') 40 self.mox.ReplayAll() 43 self.mox.VerifyAll() 51 self.mox.StubOutWithMock(common_util, 'parse_serialized_json') 55 self.mox.ReplayAll() 58 self.mox.VerifyAll() 60 self.mox.ResetAll() [all …]
|