#!/usr/bin/env python

from storage import Storage

NEW_REPORT = {'foo': 'bar', 'boo': 'baz'}
REPORTS = [
    {"/tmp/example.log": {"MD5": "53f43f9591749b8cae536ff13e48d6de", "SHA256": "815d310bdbc8684c1163b62f583dbaffb2df74b9104e2aadabf8f8491bafab66", "libmagic": "ASCII text"}},
    {"/opt/other_file": {"MD5": "96b47da202ddba8d7a6b91fecbf89a41", "SHA256": "26d11f0ea5cc77a59b6e47deee859440f26d2d14440beb712dbac8550d35ef1f", "libmagic": "a /bin/python script text executable"}},

]

def populate_es():
    db_store = Storage.get_storage()

    for report in REPORTS:
        db_store.store(report)


def main():
    db_store = Storage.get_storage()
    for key, value in db_store.__dict__.iteritems():
        print '%s: %s' % (key, value)
    print '\n'

    populate_es()
    report_id = '26d11f0ea5cc77a59b6e47deee859440f26d2d14440beb712dbac8550d35ef1f'

    print db_store.get_report(report_id)
    print db_store.get_report(3)

    # db_store.delete(report_id)
    # print db_store.delete(2)



if __name__ == '__main__':
    main()

@@ -101,15 +101,13 @@
 S = 
-%5B
+%7B
 %0A   
- %7B
 %22/tm
@@ -273,16 +273,13 @@
 xt%22%7D
-%7D
 ,%0A   
- %7B
 %22/op
@@ -470,13 +470,11 @@
 le%22%7D
-%7D
 ,%0A
-%0A%5D
+%7D
 %0A%0Ade
@@ -536,38 +536,14 @@
     
-for report in REPORTS:%0A       
+return
  db_
@@ -554,22 +554,23 @@
 e.store(
-report
+REPORTS
 )%0A%0A%0Adef 
@@ -614,16 +614,24 @@
 orage()%0A
+    '''%0A
     for 
@@ -732,26 +732,16 @@
 %5Cn'%0A
-%0A
     
-populate_es()
+'''%0A
 %0A   
@@ -754,77 +754,25 @@
 t_id
+s
  = 
-'26d11f0ea5cc77a59b6e47deee859440f26d2d14440beb712dbac8550d35ef1f'
+populate_es()
 %0A%0A  
@@ -804,24 +804,28 @@
 rt(report_id
+s%5B0%5D
 )%0A    print 
@@ -851,18 +851,16 @@
 (3)%0A%0A   
- #
  db_stor
@@ -881,15 +881,17 @@
 t_id
+s%5B0%5D
 )%0A   
- #
  pri
@@ -913,16 +913,62 @@
 ete(2)%0A%0A
+    print db_store.get_report(report_ids%5B0%5D)%0A%0A
 %0A%0Aif __n

Update test driver