def parser_should_build_data_structure_for_each_term_test(): p = Parser() terms = ['password'] args = ['-u', 'git://github.com/virtix/cato.git'] parsed = clouseau.parse_args(args) #print smoke( parsed ) ids = p.parse(terms, parsed['repo_dir']) eq_(2, len(ids), "This should have 2 keys: term (password) and meta")
def parser_should_build_data_structure_for_each_term_test(): p = Parser() terms = ['password'] args = ['-u', 'git://github.com/virtix/cato.git'] parsed = clouseau.parse_args( args ) #print smoke( parsed ) ids = p.parse(terms, parsed['repo_dir'] ) eq_(2, len(ids) , "This should have 2 keys: term (password) and meta" )
def parser_should_build_data_structure_for_each_term_test(): """ If repr doesn't exist, clone; if exists, pull Ensure appropriate data structure built for search terms """ p = Parser() terms = ['password'] args = ['-u', 'https://github.com/virtix/cato.git'] parsed = clouseau.parse_args( args ) clouseau.clone_repo( parsed['url'], parsed['repo_dir'] ) ids = p.parse(terms, parsed['repo_dir'] ) eq_(2, len(ids) , "This should have 2 keys: term (password) and meta" )
def console_client_test(): parser = Parser() terms = ['password'] args = ['-u', 'git://github.com/virtix/cato.git'] parsed = clouseau.parse_args( args ) ids = parser.parse( terms=terms, repo=parsed['repo_dir'], pathspec=parsed['pathspec'], before=parsed['before'], after=parsed['after'], author=parsed['author'], github_url=parsed['github_url']) #ids = p.parse(terms, parsed['repo_dir'] ) #print ids client = ConsoleClient() client.render( terms, ids )
def parser_should_build_data_structure_for_each_term_test(): """ If repr doesn't exist, clone; if exists, pull Ensure appropriate data structure built for search terms """ p = Parser() terms = ['password'] args = ['-u', 'https://github.com/virtix/cato.git'] parsed = clouseau.parse_args(args) clouseau.clone_repo(parsed['url'], parsed['repo_dir']) ids = p.parse(terms, parsed['repo_dir']) eq_(2, len(ids), "This should have 2 keys: term (password) and meta")
def console_client_test(): parser = Parser() terms = ['password'] args = ['-u', 'git://github.com/virtix/cato.git'] parsed = clouseau.parse_args(args) ids = parser.parse(terms=terms, repo=parsed['repo_dir'], pathspec=parsed['pathspec'], before=parsed['before'], after=parsed['after'], author=parsed['author'], github_url=parsed['github_url']) #ids = p.parse(terms, parsed['repo_dir'] ) #print ids client = ConsoleClient() client.render(terms, ids)
def smoke_test(): """ Simple smoke test """ #print "I am what I am and I am passing" parser = Parser() clouseau = Clouseau() ok_(True)
def pattern_parser_test(): parser = Parser() patterns = open( 'clouseau/patterns/default.txt', 'r' ) terms = parser.parse_terms( patterns_file=patterns, single_term=None ) ok_( len(terms) > 5 )