Ejemplo n.º 1
0
 def make_tests(self):
     """ self.tests_files[0].startswith(self.codebase.project.address)
         self.tests_files[0][len(self.codebase.project.address):]
     """
     remove_recursively(self.tests_folder)
     #remove_recursively(self.tests_folder)
     files = self.codebase.python_files
     files = [self.codebase%fpath for fpath in files]
     from pythoscope import generate_tests
     generate_tests(files, force=False, template='unittest')
Ejemplo n.º 2
0
 def make_tests(self, codebase):
     files = codebase.python_files
     files = [codebase%fpath for fpath in files]
     from pythoscope import generate_tests
     generate_tests(files, force=False, template='unittest')
Ejemplo n.º 3
0
            init = True
        elif opt in ("-t", "--template"):
            template = value
        elif opt in ("-q", "--quiet"):
            log.level = logger.ERROR
        elif opt in ("-v", "--verbose"):
            log.level = logger.DEBUG
        elif opt in ("-V", "--version"):
            print "%s %s" % (appname, __version__)
            sys.exit()

    try:
        if init:
            if args:
                project_path = args[0]
            else:
                project_path = "."
            init_project(project_path)
        else:
            if not args:
                log.error("You didn't specify any modules for test generation.\n")
                print USAGE % appname
            else:
                generate_tests(args, force, template)

    except KeyboardInterrupt:
        log.info("Interrupted by the user.")
    except Exception: # SystemExit gets through
        log.error("Oops, it seems that an internal Pythoscope error occurred. Please file a bug report at %s\n" % BUGTRACKER_URL)
        raise