Beispiel #1
0
def test_single_other_query():
        args = ['-q', 'linear', '-t', 'Topology', '-o', "%s/query_o.csv" % tmpdir]  + base_args
        opts = parse_args(args)
        manage_pickle.run('query', opts)
        
        assert filecmp.cmp("%s/query_o.csv" % tmpdir, 'test/data/query_o.exp')
        
        cleanup()       
Beispiel #2
0
def test_update():
        args = ['-f', 'test/data/notes.txt', '-t', 'Notes']  + base_args
        opts = parse_args(args)
        manage_pickle.run('update', opts)
        
        args = ['-f', "%s/updated.csv" % tmpdir]  + base_args
        opts = parse_args(args)
        manage_pickle.run('save', opts)
        
        assert filecmp.cmp("%s/updated.csv" % tmpdir, 'test/data/exp_updated.csv')
Beispiel #3
0
                -f|file        CSV output file
                -d|database    name of database
                
                Example:
                resistome.py save -f output_db.csv -d resistome1

        avail:  list available databases
        
                Example:
                resistome.py avail
                
        help:   Show this help menu
            """


# MAIN
args = sys.argv[1:]
try:
    mode = args.pop(0)
except IndexError:
    print_usage()
    sys.exit()

if mode in ['add', 'query', 'update', 'save', 'avail', 'test']:
    opts = parse_args(args)
    manage_pickle.run(mode, opts)
elif mode == 'help':
    print_usage()
else:
    print "Please specify valid mode:"
    print_usage()
Beispiel #4
0
def test_file_acc_query():
        args = ['-f', 'test/data/q.txt', '-o', "%s/query_f.csv" % tmpdir]  + base_args
        opts = parse_args(args)
        manage_pickle.run('query', opts)
        
        assert filecmp.cmp("%s/query_f.csv" % tmpdir, 'test/data/query_f.exp')
Beispiel #5
0
def test_single_acc_query():
        args = ['-q', 'CP000356', '-o', "%s/query_s.csv" % tmpdir]  + base_args
        opts = parse_args(args)
        manage_pickle.run('query', opts)
        
        assert filecmp.cmp("%s/query_s.csv" % tmpdir, 'test/data/query_s.exp')
Beispiel #6
0
def test_save():
        args = ['-f', "%s/test.csv" % tmpdir]  + base_args
        opts = parse_args(args)
        manage_pickle.run('save', opts)
        
        assert filecmp.cmp("%s/test.csv" % tmpdir, 'test/data/exp.csv')
Beispiel #7
0
def test_add():
        args = ['-f', 'test/data/small_db.txt'] + base_args
        opts = parse_args(args)
        manage_pickle.run('add', opts)
        
        assert os.path.exists("%s/resistome_testing.db" % tmpdir)