def test_build_with_watcher(self):
    check_function_calls = {'ensure_files_exist_gets_called': False, 'compile_typescript_files_continuously_gets_called': False}
    expected_check_function_calls = {'ensure_files_exist_gets_called': True, 'compile_typescript_files_continuously_gets_called': True}

    def mock_ensure_files_exist(unused_filepaths):
        check_function_calls['ensure_files_exist_gets_called'] = True

    def mock_compile_typescript_files_continuously(unused_project_dir):
        check_function_calls['compile_typescript_files_continuously_gets_called'] = True
    ensure_files_exist_swap = self.swap(build, '_ensure_files_exist', mock_ensure_files_exist)
    compile_typescript_files_continuously_swap = self.swap(build, 'compile_typescript_files_continuously', mock_compile_typescript_files_continuously)
    args_swap = self.swap(sys, 'argv', ['build.py', '--enable_watcher'])
    with ensure_files_exist_swap, compile_typescript_files_continuously_swap, args_swap:
        build.build()
    self.assertEqual(check_function_calls, expected_check_function_calls)
def test_build_with_watcher(self):
    check_function_calls = {'ensure_files_exist_gets_called': False, 'compile_typescript_files_continuously_gets_called': False}
    expected_check_function_calls = {'ensure_files_exist_gets_called': True, 'compile_typescript_files_continuously_gets_called': True}

    def mock_ensure_files_exist(unused_filepaths):
        check_function_calls['ensure_files_exist_gets_called'] = True

    def mock_compile_typescript_files_continuously(unused_project_dir):
        check_function_calls['compile_typescript_files_continuously_gets_called'] = True
    ensure_files_exist_swap = self.swap(build, '_ensure_files_exist', mock_ensure_files_exist)
    compile_typescript_files_continuously_swap = self.swap(build, 'compile_typescript_files_continuously', mock_compile_typescript_files_continuously)
    args_swap = self.swap(sys, 'argv', ['build.py', '--enable_watcher'])
    with ensure_files_exist_swap, compile_typescript_files_continuously_swap, args_swap:
        build.build()
    self.assertEqual(check_function_calls, expected_check_function_calls)