Ejemplo n.º 1
0
 def test_non_pythonpath_dep(self):
     conf = self.parser.config_from_defaults()
     d = self.normalize('foo/')
     conf.pythonpath = [d]
     dep = file_utils.expand_path('bar/baz.py')
     runner = pytype_runner.PytypeRunner([], [[dep]], conf)
     self.assert_sorted_modules_equal(runner.yield_sorted_modules(), [])
Ejemplo n.º 2
0
def make_converters(cwd=None):
    """For items that need coaxing into their internal representations."""
    return {
        'exclude': lambda v: file_utils.expand_source_files(v, cwd),
        'inputs': lambda v: file_utils.expand_source_files(v, cwd),
        'output': lambda v: file_utils.expand_path(v, cwd),
        'pythonpath': lambda v: file_utils.expand_pythonpath(v, cwd),
    }
Ejemplo n.º 3
0
def make_converters(cwd=None):
  """For items that need coaxing into their internal representations."""
  return {
      'exclude': lambda v: file_utils.expand_source_files(v, cwd),
      'keep_going': string_to_bool,
      'inputs': lambda v: file_utils.expand_source_files(v, cwd),
      'output': lambda v: file_utils.expand_path(v, cwd),
      'python_version': get_python_version,
      'pythonpath': lambda v: file_utils.expand_pythonpath(v, cwd),
      'disable': concat_disabled_rules,
  }
Ejemplo n.º 4
0
 def test_expand_with_cwd(self):
     with file_utils.Tempdir() as d:
         f = d.create_file("foo.py")
         self.assertEqual(file_utils.expand_path("foo.py", d.path), f)
Ejemplo n.º 5
0
 def test_expand_one_path(self):
     full_path = os.path.join(os.getcwd(), "foo.py")
     self.assertEqual(file_utils.expand_path("foo.py"), full_path)
Ejemplo n.º 6
0
 def normalize(self, d):
     return file_utils.expand_path(d).rstrip(os.sep) + os.sep