コード例 #1
0
ファイル: integration_tests.py プロジェクト: lfatty/clouseau
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")
コード例 #2
0
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" )
コード例 #3
0
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" )
コード例 #4
0
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 )
コード例 #5
0
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")
コード例 #6
0
ファイル: integration_tests.py プロジェクト: lfatty/clouseau
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)
コード例 #7
0
def smoke_test():
    """
    Simple smoke test
    """
    #print "I am what I am and I am passing"
    parser = Parser()
    clouseau = Clouseau()
    ok_(True)
コード例 #8
0
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 )