Commit dd656cc0 authored by Brian Sheedy's avatar Brian Sheedy Committed by Commit Bot

Switch NaCL Python tests to use vpython mock

Switches the NaCL Python tests to use the version of mock/pymock
provided by vpython instead of manually importing the version from
//third_party/pymock. This is so that the //third_party version can
eventually be removed.

Also drive-by fixes some unidiomatic-typecheck PyLint warnings that
presubmit complained about.

Bug: 1094489
Change-Id: I886a9eaa9130c8babbefc40281c0de7f984026c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2254583
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Commit-Queue: Sam Clegg <sbc@chromium.org>
Reviewed-by: default avatarSam Clegg <sbc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#780408}
parent d13ce126
...@@ -113,14 +113,14 @@ class Archive(object): ...@@ -113,14 +113,14 @@ class Archive(object):
buildbot_common.MakeDir(self.dirname) buildbot_common.MakeDir(self.dirname)
def Copy(self, src_root, file_list): def Copy(self, src_root, file_list):
if type(file_list) is not list: if not isinstance(file_list, list):
file_list = [file_list] file_list = [file_list]
for file_spec in file_list: for file_spec in file_list:
# The list of files to install can be a simple list of # The list of files to install can be a simple list of
# strings or a list of pairs, where each pair corresponds # strings or a list of pairs, where each pair corresponds
# to a mapping from source to destination names. # to a mapping from source to destination names.
if type(file_spec) is str: if isinstance(file_spec, str):
src_file = dest_file = file_spec src_file = dest_file = file_spec
else: else:
src_file, dest_file = file_spec src_file, dest_file = file_spec
...@@ -192,7 +192,7 @@ def MakeNinjaRelPath(path): ...@@ -192,7 +192,7 @@ def MakeNinjaRelPath(path):
def NinjaBuild(targets, out_dir): def NinjaBuild(targets, out_dir):
if type(targets) is not list: if not isinstance(targets, list):
targets = [targets] targets = [targets]
out_config_dir = os.path.join(out_dir, 'Release') out_config_dir = os.path.join(out_dir, 'Release')
buildbot_common.Run(['ninja', '-C', out_config_dir] + targets, cwd=SRC_DIR) buildbot_common.Run(['ninja', '-C', out_config_dir] + targets, cwd=SRC_DIR)
......
...@@ -284,7 +284,7 @@ def InstallFiles(src_root, dest_root, file_list): ...@@ -284,7 +284,7 @@ def InstallFiles(src_root, dest_root, file_list):
# The list of files to install can be a simple list of # The list of files to install can be a simple list of
# strings or a list of pairs, where each pair corresponds # strings or a list of pairs, where each pair corresponds
# to a mapping from source to destination names. # to a mapping from source to destination names.
if type(file_spec) == str: if isinstance(file_spec, str):
src_file = dest_file = file_spec src_file = dest_file = file_spec
else: else:
src_file, dest_file = file_spec src_file, dest_file = file_spec
......
...@@ -91,7 +91,7 @@ def ExtractArchive(archive_path, destdirs): ...@@ -91,7 +91,7 @@ def ExtractArchive(archive_path, destdirs):
Untar(archive_path, EXTRACT_ARCHIVE_DIR) Untar(archive_path, EXTRACT_ARCHIVE_DIR)
basename = RemoveExt(os.path.basename(archive_path)) basename = RemoveExt(os.path.basename(archive_path))
srcdir = os.path.join(EXTRACT_ARCHIVE_DIR, basename) srcdir = os.path.join(EXTRACT_ARCHIVE_DIR, basename)
if type(destdirs) is not list: if not isinstance(destdirs, list):
destdirs = [destdirs] destdirs = [destdirs]
for destdir in destdirs: for destdir in destdirs:
...@@ -106,7 +106,7 @@ def ExtractAll(archive_dict, archive_dir, destroot): ...@@ -106,7 +106,7 @@ def ExtractAll(archive_dict, archive_dir, destroot):
for archive_part, rel_destdirs in archive_dict: for archive_part, rel_destdirs in archive_dict:
archive_name = '%s_%s.tar.bz2' % (PLATFORM, archive_part) archive_name = '%s_%s.tar.bz2' % (PLATFORM, archive_part)
archive_path = os.path.join(archive_dir, archive_name) archive_path = os.path.join(archive_dir, archive_name)
if type(rel_destdirs) is not list: if not isinstance(rel_destdirs, list):
rel_destdirs = [rel_destdirs] rel_destdirs = [rel_destdirs]
destdirs = [os.path.join(destroot, d) for d in rel_destdirs] destdirs = [os.path.join(destroot, d) for d in rel_destdirs]
ExtractArchive(archive_path, destdirs) ExtractArchive(archive_path, destdirs)
......
...@@ -102,12 +102,12 @@ def ValidateFormat(src, dsc_format): ...@@ -102,12 +102,12 @@ def ValidateFormat(src, dsc_format):
# then the list applies to all keys of the dictionary, so we reset # then the list applies to all keys of the dictionary, so we reset
# the expected type and value. # the expected type and value.
if exp_type is dict: if exp_type is dict:
if type(value) is list: if isinstance(value, list):
exp_type = list exp_type = list
exp_value = '' exp_value = ''
# Verify the key is of the expected type # Verify the key is of the expected type
if exp_type != type(value): if not isinstance(value, exp_type):
raise ValidationError('Key %s expects %s not %s.' % ( raise ValidationError('Key %s expects %s not %s.' % (
key, exp_type.__name__.upper(), type(value).__name__.upper())) key, exp_type.__name__.upper(), type(value).__name__.upper()))
...@@ -117,7 +117,7 @@ def ValidateFormat(src, dsc_format): ...@@ -117,7 +117,7 @@ def ValidateFormat(src, dsc_format):
# If it's a string and there are expected values, make sure it matches # If it's a string and there are expected values, make sure it matches
if exp_type is str: if exp_type is str:
if type(exp_value) is list and exp_value: if isinstance(exp_value, list) and exp_value:
if value not in exp_value: if value not in exp_value:
raise ValidationError("Value '%s' not expected for %s." % raise ValidationError("Value '%s' not expected for %s." %
(value, key)) (value, key))
...@@ -126,19 +126,19 @@ def ValidateFormat(src, dsc_format): ...@@ -126,19 +126,19 @@ def ValidateFormat(src, dsc_format):
# if it's a list, then we need to validate the values # if it's a list, then we need to validate the values
if exp_type is list: if exp_type is list:
# If we expect a dictionary, then call this recursively # If we expect a dictionary, then call this recursively
if type(exp_value) is dict: if isinstance(exp_value, dict):
for val in value: for val in value:
ValidateFormat(val, exp_value) ValidateFormat(val, exp_value)
continue continue
# If we expect a list of strings # If we expect a list of strings
if type(exp_value) is str: if isinstance(exp_value, str):
for val in value: for val in value:
if type(val) is not str: if not isinstance(val, str):
raise ValidationError('Value %s in %s is not a string.' % raise ValidationError('Value %s in %s is not a string.' %
(val, key)) (val, key))
continue continue
# if we expect a particular string # if we expect a particular string
if type(exp_value) is list: if isinstance(exp_value, list):
for val in value: for val in value:
if val not in exp_value: if val not in exp_value:
raise ValidationError('Value %s not expected in %s.' % raise ValidationError('Value %s not expected in %s.' %
...@@ -228,9 +228,9 @@ def DescMatchesFilter(desc, filters): ...@@ -228,9 +228,9 @@ def DescMatchesFilter(desc, filters):
value = desc.get(key, False) value = desc.get(key, False)
# If we provide an expected list, match at least one # If we provide an expected list, match at least one
if type(expected) not in (list, tuple): if not isinstance(expected, (list, tuple)):
expected = set([expected]) expected = set([expected])
if type(value) != list: if not isinstance(value, list):
value = set([value]) value = set([value])
if not set(expected) & set(value): if not set(expected) & set(value):
......
...@@ -222,7 +222,7 @@ def GetTestName(desc, toolchain, config): ...@@ -222,7 +222,7 @@ def GetTestName(desc, toolchain, config):
def IsTestDisabled(desc, toolchain, config): def IsTestDisabled(desc, toolchain, config):
def AsList(value): def AsList(value):
if type(value) not in (list, tuple): if not isinstance(value, (list, tuple)):
return [value] return [value]
return value return value
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright (c) 2014 The Chromium Authors. All rights reserved. # Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
...@@ -13,10 +13,7 @@ import unittest ...@@ -13,10 +13,7 @@ import unittest
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
BUILD_TOOLS_DIR = os.path.dirname(SCRIPT_DIR) BUILD_TOOLS_DIR = os.path.dirname(SCRIPT_DIR)
CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(BUILD_TOOLS_DIR))) CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(BUILD_TOOLS_DIR)))
MOCK_DIR = os.path.join(CHROME_SRC, 'third_party', 'pymock')
# For the mock library
sys.path.append(MOCK_DIR)
from mock import call, patch, Mock from mock import call, patch, Mock
sys.path.append(BUILD_TOOLS_DIR) sys.path.append(BUILD_TOOLS_DIR)
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright (c) 2014 The Chromium Authors. All rights reserved. # Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
...@@ -11,10 +11,7 @@ import unittest ...@@ -11,10 +11,7 @@ import unittest
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
BUILD_TOOLS_DIR = os.path.dirname(SCRIPT_DIR) BUILD_TOOLS_DIR = os.path.dirname(SCRIPT_DIR)
CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(BUILD_TOOLS_DIR))) CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(BUILD_TOOLS_DIR)))
MOCK_DIR = os.path.join(CHROME_SRC, 'third_party', 'pymock')
# For the mock library
sys.path.append(MOCK_DIR)
import mock import mock
sys.path.append(BUILD_TOOLS_DIR) sys.path.append(BUILD_TOOLS_DIR)
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
...@@ -12,11 +12,9 @@ import unittest ...@@ -12,11 +12,9 @@ import unittest
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
TOOLS_DIR = os.path.dirname(SCRIPT_DIR) TOOLS_DIR = os.path.dirname(SCRIPT_DIR)
CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(TOOLS_DIR))) CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(TOOLS_DIR)))
MOCK_DIR = os.path.join(CHROME_SRC, 'third_party', 'pymock')
BUILD_TOOLS_DIR = os.path.dirname(SCRIPT_DIR) BUILD_TOOLS_DIR = os.path.dirname(SCRIPT_DIR)
sys.path.append(BUILD_TOOLS_DIR) sys.path.append(BUILD_TOOLS_DIR)
sys.path.append(MOCK_DIR)
import easy_template import easy_template
import mock import mock
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
...@@ -10,10 +10,8 @@ import unittest ...@@ -10,10 +10,8 @@ import unittest
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
BUILD_TOOLS_DIR = os.path.dirname(SCRIPT_DIR) BUILD_TOOLS_DIR = os.path.dirname(SCRIPT_DIR)
CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(BUILD_TOOLS_DIR))) CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(BUILD_TOOLS_DIR)))
MOCK_DIR = os.path.join(CHROME_SRC, 'third_party', 'pymock')
sys.path.append(BUILD_TOOLS_DIR) sys.path.append(BUILD_TOOLS_DIR)
sys.path.append(MOCK_DIR)
import mock import mock
import test_projects import test_projects
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
...@@ -10,10 +10,7 @@ import unittest ...@@ -10,10 +10,7 @@ import unittest
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
BUILD_TOOLS_DIR = os.path.dirname(SCRIPT_DIR) BUILD_TOOLS_DIR = os.path.dirname(SCRIPT_DIR)
CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(BUILD_TOOLS_DIR))) CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(BUILD_TOOLS_DIR)))
MOCK_DIR = os.path.join(CHROME_SRC, 'third_party', 'pymock')
# For the mock library
sys.path.append(MOCK_DIR)
import mock import mock
sys.path.append(BUILD_TOOLS_DIR) sys.path.append(BUILD_TOOLS_DIR)
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
......
...@@ -84,7 +84,7 @@ def main(args): ...@@ -84,7 +84,7 @@ def main(args):
raise Error('%s does not have "platforms" key.' % options.manifest_json) raise Error('%s does not have "platforms" key.' % options.manifest_json)
platforms = data['platforms'] platforms = data['platforms']
if type(platforms) is not list: if not isinstance(platforms, list):
raise Error('Expected "platforms" key to be array.') raise Error('Expected "platforms" key to be array.')
if options.prefix: if options.prefix:
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
...@@ -11,10 +11,8 @@ import tempfile ...@@ -11,10 +11,8 @@ import tempfile
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARENT_DIR = os.path.dirname(SCRIPT_DIR) PARENT_DIR = os.path.dirname(SCRIPT_DIR)
CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(PARENT_DIR))) CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(PARENT_DIR)))
MOCK_DIR = os.path.join(CHROME_SRC, 'third_party', 'pymock')
sys.path.append(PARENT_DIR) sys.path.append(PARENT_DIR)
sys.path.append(MOCK_DIR)
import create_html import create_html
import mock import mock
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
...@@ -16,10 +16,7 @@ TOOLS_DIR = os.path.dirname(SCRIPT_DIR) ...@@ -16,10 +16,7 @@ TOOLS_DIR = os.path.dirname(SCRIPT_DIR)
DATA_DIR = os.path.join(TOOLS_DIR, 'lib', 'tests', 'data') DATA_DIR = os.path.join(TOOLS_DIR, 'lib', 'tests', 'data')
BUILD_TOOLS_DIR = os.path.join(os.path.dirname(TOOLS_DIR), 'build_tools') BUILD_TOOLS_DIR = os.path.join(os.path.dirname(TOOLS_DIR), 'build_tools')
CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(TOOLS_DIR))) CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(TOOLS_DIR)))
MOCK_DIR = os.path.join(CHROME_SRC, 'third_party', 'pymock')
# For the mock library
sys.path.append(MOCK_DIR)
sys.path.append(TOOLS_DIR) sys.path.append(TOOLS_DIR)
sys.path.append(BUILD_TOOLS_DIR) sys.path.append(BUILD_TOOLS_DIR)
...@@ -287,9 +284,9 @@ class TestNmfUtils(unittest.TestCase): ...@@ -287,9 +284,9 @@ class TestNmfUtils(unittest.TestCase):
new_k = StripSo(k) new_k = StripSo(k)
if isinstance(v, (str, unicode)): if isinstance(v, (str, unicode)):
new_v = StripSo(v) new_v = StripSo(v)
elif type(v) is list: elif isinstance(v, list):
new_v = v[:] new_v = v[:]
elif type(v) is dict: elif isinstance(v, dict):
new_v = StripSoCopyDict(v) new_v = StripSoCopyDict(v)
else: else:
# Assume that anything else can be copied directly. # Assume that anything else can be copied directly.
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
...@@ -11,10 +11,7 @@ SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) ...@@ -11,10 +11,7 @@ SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARENT_DIR = os.path.dirname(SCRIPT_DIR) PARENT_DIR = os.path.dirname(SCRIPT_DIR)
DATA_DIR = os.path.join(SCRIPT_DIR, 'data') DATA_DIR = os.path.join(SCRIPT_DIR, 'data')
CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(PARENT_DIR))) CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(PARENT_DIR)))
MOCK_DIR = os.path.join(CHROME_SRC, 'third_party', 'pymock')
# For the mock library
sys.path.append(MOCK_DIR)
sys.path.append(PARENT_DIR) sys.path.append(PARENT_DIR)
import fix_deps import fix_deps
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
...@@ -12,10 +12,7 @@ import unittest ...@@ -12,10 +12,7 @@ import unittest
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
TOOLS_DIR = os.path.dirname(SCRIPT_DIR) TOOLS_DIR = os.path.dirname(SCRIPT_DIR)
CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(TOOLS_DIR))) CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(TOOLS_DIR)))
MOCK_DIR = os.path.join(CHROME_SRC, 'third_party', 'pymock')
# For the mock library
sys.path.append(MOCK_DIR)
import mock import mock
# For getos, the module under test # For getos, the module under test
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
...@@ -14,10 +14,8 @@ import urllib2 ...@@ -14,10 +14,8 @@ import urllib2
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
TOOLS_DIR = os.path.dirname(SCRIPT_DIR) TOOLS_DIR = os.path.dirname(SCRIPT_DIR)
CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(TOOLS_DIR))) CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(TOOLS_DIR)))
MOCK_DIR = os.path.join(CHROME_SRC, 'third_party', 'pymock')
sys.path.append(TOOLS_DIR) sys.path.append(TOOLS_DIR)
sys.path.append(MOCK_DIR)
import httpd import httpd
from mock import patch, Mock from mock import patch, Mock
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright 2013 The Chromium Authors. All rights reserved. # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
...@@ -10,10 +10,7 @@ import unittest ...@@ -10,10 +10,7 @@ import unittest
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
TOOLS_DIR = os.path.dirname(SCRIPT_DIR) TOOLS_DIR = os.path.dirname(SCRIPT_DIR)
CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(TOOLS_DIR))) CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(TOOLS_DIR)))
MOCK_DIR = os.path.join(CHROME_SRC, 'third_party', 'pymock')
# For the mock library
sys.path.append(MOCK_DIR)
import mock import mock
# For nacl_config, the module under test # For nacl_config, the module under test
......
#!/usr/bin/env python #!/usr/bin/env vpython
# Copyright 2013 The Chromium Authors. All rights reserved. # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
...@@ -11,10 +11,7 @@ SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) ...@@ -11,10 +11,7 @@ SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARENT_DIR = os.path.dirname(SCRIPT_DIR) PARENT_DIR = os.path.dirname(SCRIPT_DIR)
DATA_DIR = os.path.join(SCRIPT_DIR, 'data') DATA_DIR = os.path.join(SCRIPT_DIR, 'data')
CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(PARENT_DIR))) CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(PARENT_DIR)))
MOCK_DIR = os.path.join(CHROME_SRC, 'third_party', 'pymock')
# For the mock library
sys.path.append(MOCK_DIR)
sys.path.append(PARENT_DIR) sys.path.append(PARENT_DIR)
import sel_ldr import sel_ldr
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment