def setup_cmd_parser(cls): """Returns the CoLic argument parser.""" parser = GraalCommand.setup_cmd_parser(cls.BACKEND.CATEGORIES, exec_path=True) return parser
def test_gitpath_init(self): """Test gitpath initialization""" args = ['http://example.com/', '--git-path', '/tmp/gitpath'] cmd = GraalCommand(*args) self.assertEqual(cmd.parsed_args.gitpath, '/tmp/gitpath')
def test_setup_cmd_parser(self): """Test if it parser object is correctly initialized""" parser = GraalCommand.setup_cmd_parser() self.assertIsInstance(parser, BackendCommandArgumentParser) args = [ 'http://example.com/', '--git-path', '/tmp/gitpath', '--tag', 'test' ] parsed_args = parser.parse(*args) self.assertEqual(parsed_args.uri, 'http://example.com/') self.assertEqual(parsed_args.git_path, '/tmp/gitpath') self.assertEqual(parsed_args.tag, 'test') self.assertEqual(parsed_args.from_date, DEFAULT_DATETIME) self.assertEqual(parsed_args.to_date, None) self.assertEqual(parsed_args.branches, None) self.assertFalse(parsed_args.latest_items) self.assertEqual(parsed_args.worktreepath, DEFAULT_WORKTREE_PATH) self.assertEqual(parsed_args.in_paths, None) self.assertEqual(parsed_args.out_paths, None) self.assertEqual(parsed_args.entrypoint, None) self.assertFalse(parsed_args.details) args = [ 'http://example.com/', '--git-path', '/tmp/gitpath', '--tag', 'test', '--from-date', '1975-01-01', '--to-date', '2099-01-01', '--branches', 'master', 'testing', '--latest-items', '--worktree-path', '/tmp/custom-worktrees/', '--in-paths', '*.py', '*.java', '--out-paths', '*.c', '--entrypoint', 'module', '--details' ] parsed_args = parser.parse(*args) self.assertEqual(parsed_args.uri, 'http://example.com/') self.assertEqual(parsed_args.git_path, '/tmp/gitpath') self.assertEqual(parsed_args.tag, 'test') self.assertEqual(parsed_args.from_date, str_to_datetime('1975-01-01')) self.assertEqual(parsed_args.to_date, str_to_datetime('2099-01-01')) self.assertEqual(parsed_args.branches, ['master', 'testing']) self.assertTrue(parsed_args.latest_items) self.assertEqual(parsed_args.worktreepath, '/tmp/custom-worktrees/') self.assertEqual(parsed_args.in_paths, ['*.py', '*.java']) self.assertEqual(parsed_args.out_paths, ['*.c']) self.assertEqual(parsed_args.entrypoint, 'module') self.assertTrue(parsed_args.details)
def setup_cmd_parser(cls): """Returns the CoLang argument parser.""" parser = GraalCommand.setup_cmd_parser(cls.BACKEND.CATEGORIES) return parser
def setup_cmd_parser(cls): parser = GraalCommand.setup_cmd_parser(cls.BACKEND) return parser
def setup_cmd_parser(): """Returns the CoLic argument parser.""" parser = GraalCommand.setup_cmd_parser(exec_path=True) return parser
# You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # Author: # Sumit Kumar Jangir <*****@*****.**> # imports import os import shutil from graal.graal import GraalRepository, GraalCommand from graal.backends.core.analyzers.flake8 import Flake8 # setting graal argument parser parser = GraalCommand.setup_cmd_parser() arg = ['https://github.com/sumitskj/GSOC-Chaoss.git'] args = parser.parse(*arg) # repository url repo_uri = args.uri # commit SHA sha = '9230281aa93a593939f9dfff4a207f9e8140cb4f' # worktree directory path worktreepath = '/tmp/worktrees' # path of repository cloned
def setup_cmd_parser(cls): """Returns the CoDep argument parser.""" parser = GraalCommand.setup_cmd_parser(cls.BACKEND) return parser
def setup_cmd_parser(cls): parser = GraalCommand.setup_cmd_parser(cls.BACKEND.CATEGORIES) return parser