Ejemplo n.º 1
0
 def test_install_enry(self):
     with tempfile.TemporaryDirectory() as tmpdir:
         args = argparse.Namespace(output=tmpdir,
                                   tmpdir=None,
                                   force_build=True)
         self.assertIsNone(install_enry(args))
         self._valivate_enry(tmpdir)
Ejemplo n.º 2
0
def pylib2uast_entry(args):
    log = logging.getLogger("pylib2uast")
    module_names = args.input
    module_dirs = []
    for lib_name in args.input:
        try:
            module = __import__(lib_name)
            module_dir = os.path.abspath(os.path.dirname(module.__file__))
            module_dirs.append(module_dir)
        except ModuleNotFoundError as e:
            log.error("No module named '%s'. Skipping.")

    args.input = module_dirs

    install_enry()
    repos2uast_entry(args)
    for file in os.listdir(args.output):
        for name in module_names:
            if name in file:
                break
        os.rename(os.path.join(args.output, file),
                  os.path.join(args.output, name + '.asdf'))
Ejemplo n.º 3
0
 def test_install_enry_no_args(self):
     with tempfile.TemporaryDirectory() as tmpdir:
         self.assertIsNone(
             install_enry(target=os.path.join(tmpdir, "enry")))
         self._valivate_enry(tmpdir)