예제 #1
0
    def test_simple_get_encrypt_and_restore(self):
        """
           get few emails and restore them
        """
        db_dir = '/tmp/gmail_bk'
        #clean db dir
        delete_db_dir(db_dir)

        print("Synchronize\n")

        sys.argv = [
            'gmvault.py', 'sync', '-t', 'custom', '--encrypt', '-r',
            'Since 1-Nov-2011 Before 3-Nov-2011', '--db-dir', db_dir,
            '*****@*****.**'
        ]

        gmv_cmd.bootstrap_run()

        print("Restore\n")

        sys.argv = [
            'gmvault.py', 'restore', '--db-dir', db_dir,
            '*****@*****.**'
        ]

        gmv_cmd.bootstrap_run()
예제 #2
0
 def ztest_quick_sync_with_labels(self):
     """
        Test quick sync
        --renew-passwd
     """
     sys.argv = ['gmvault.py', 'sync', self.login]
     
     gmv_cmd.bootstrap_run()
예제 #3
0
 def ztest_restore_with_labels(self):
     """
        Test restore with labels
     """
     
     sys.argv = ['gmvault.py', 'restore', '--restart', '--db-dir', '/Users/gaubert/Dev/projects/gmvault/src/gmv/gmvault-db', '*****@*****.**']
     
     gmv_cmd.bootstrap_run()
예제 #4
0
 def ztest_debug_restore(self):
     """
        double login
     """
     # now read the password
     sys.argv = ['gmvault.py', 'restore', '--db-dir', '/Users/gaubert/Dev/projects/gmvault/src/gmv/gmvault-db', '*****@*****.**']
     
     gmv_cmd.bootstrap_run()
예제 #5
0
    def ztest_quick_sync_with_labels(self):
        """
           Test quick sync
           --renew-passwd
        """
        sys.argv = ['gmvault.py', 'sync', self.login]

        gmv_cmd.bootstrap_run()
예제 #6
0
 def ztest_restore_with_labels(self):
     """
        Test restore with labels
     """
     
     sys.argv = ['gmvault.py', 'restore', '--restart', '--db-dir', '/Users/gaubert/Dev/projects/gmvault/src/gmv/gmvault-db', '*****@*****.**']
     
     gmv_cmd.bootstrap_run()
예제 #7
0
 def ztest_debug_restore(self):
     """
        double login
     """
     # now read the password
     sys.argv = ['gmvault.py', 'restore', '--db-dir', '/Users/gaubert/Dev/projects/gmvault/src/gmv/gmvault-db', '*****@*****.**']
     
     gmv_cmd.bootstrap_run()
예제 #8
0
    def test_memory_error_bug(self):
        """
           Try to push the memory error
        """
        # now read the password
        import sys
        import gmv.gmv_cmd as gmv_cmd
        import email
        
        fd = open('/Users/gaubert/gmvault-data/gmvault-db-bug/db/2004-10/1399791159741721320.eml')
        email_body = fd.read()
        mail = email.message_from_string(email_body)

        print mail
        
        sys.argv = ['gmvault.py', 'restore', '--db-dir', '/Users/gaubert/gmvault-data/gmvault-db-bug', '*****@*****.**']
        
        gmv_cmd.bootstrap_run()
예제 #9
0
    def ztest_memory_error_bug(self):
        """
           Try to push the memory error
        """
        # now read the password
        import sys
        import gmv.gmv_cmd as gmv_cmd
        import email
        
        fd = open('/Users/gaubert/gmvault-data/gmvault-db-bug/db/2004-10/1399791159741721320.eml')
        email_body = fd.read()
        mail = email.message_from_string(email_body)

        print mail
        
        sys.argv = ['gmvault.py', 'restore', '--db-dir', '/Users/gaubert/gmvault-data/gmvault-db-bug', '*****@*****.**']
        
        gmv_cmd.bootstrap_run()
예제 #10
0
    def ztest_simple_get_encrypt_and_restore(self):
        """
           get few emails and restore them
        """
        db_dir = '/tmp/gmail_bk'
        #clean db dir
        delete_db_dir(db_dir)
        
        print("Synchronize\n")
        
        sys.argv = ['gmvault.py', 'sync', '-t', 'custom', '--encrypt','-r', 'Since 1-Nov-2011 Before 3-Nov-2011', '--db-dir', db_dir, '*****@*****.**']

        gmv_cmd.bootstrap_run()
        
        print("Restore\n")
        
        sys.argv = ['gmvault.py', 'restore', '--db-dir', db_dir, '*****@*****.**']

        gmv_cmd.bootstrap_run()
예제 #11
0
 def ztest_delete_sync_gmv(self):
     """
        delete sync via command line
     """
     delete_db_dir('/tmp/new-db-1')
     
     #first request to have the extra dirs
     sys.argv = ['gmvault.py', 'sync', '-t', 'custom', '-r', \
                 'Since 1-Nov-2011 Before 7-Nov-2011', \
                 '--db-dir', '/tmp/new-db-1', '*****@*****.**']
     
     #check all stored gmail ids
     gstorer = gmvault_db.GmailStorer('/tmp/new-db-1')
     
     gmv_cmd.bootstrap_run()
     
     ids = gstorer.get_all_existing_gmail_ids()
     
     self.assertEquals(len(ids), 9)
     
     delete_db_dir('/tmp/new-db-1')
     
     #second requests so all files after the 5 should disappear 
     sys.argv = ['gmvault.py', 'sync', '-t', 'custom', '-r', \
                 'Since 1-Nov-2011 Before 5-Nov-2011', \
                 '--db-dir', '/tmp/new-db-1', '-c', 'yes', '*****@*****.**']
 
     gmv_cmd.bootstrap_run()
 
     gstorer = gmvault_db.GmailStorer('/tmp/new-db-1')
     
     ids = gstorer.get_all_existing_gmail_ids()
     
     self.assertEquals(len(ids), 5)
     
     self.assertEquals(ids, {1384403887202624608L: '2011-11', \
                             1384486067720566818L: '2011-11', \
                             1384313269332005293L: '2011-11', \
                             1384545182050901969L: '2011-11', \
                             1384578279292583731L: '2011-11'})
예제 #12
0
 def ztest_delete_sync_gmv(self):
     """
        delete sync via command line
     """
     delete_db_dir('/tmp/new-db-1')
     
     #first request to have the extra dirs
     sys.argv = ['gmvault.py', 'sync', '-t', 'custom', '-r', \
                 'Since 1-Nov-2011 Before 7-Nov-2011', \
                 '--db-dir', '/tmp/new-db-1', '*****@*****.**']
     
     #check all stored gmail ids
     gstorer = gmvault_db.GmailStorer('/tmp/new-db-1')
     
     gmv_cmd.bootstrap_run()
     
     ids = gstorer.get_all_existing_gmail_ids()
     
     self.assertEquals(len(ids), 9)
     
     delete_db_dir('/tmp/new-db-1')
     
     #second requests so all files after the 5 should disappear 
     sys.argv = ['gmvault.py', 'sync', '-t', 'custom', '-r', \
                 'Since 1-Nov-2011 Before 5-Nov-2011', \
                 '--db-dir', '/tmp/new-db-1', '-c', 'yes', '*****@*****.**']
 
     gmv_cmd.bootstrap_run()
 
     gstorer = gmvault_db.GmailStorer('/tmp/new-db-1')
     
     ids = gstorer.get_all_existing_gmail_ids()
     
     self.assertEquals(len(ids), 5)
     
     self.assertEquals(ids, {1384403887202624608L: '2011-11', \
                             1384486067720566818L: '2011-11', \
                             1384313269332005293L: '2011-11', \
                             1384545182050901969L: '2011-11', \
                             1384578279292583731L: '2011-11'})
예제 #13
0
파일: gmvault.py 프로젝트: B-Rich/nixpkgs
#!/usr/bin/env python

import gmv.gmv_cmd as runner

runner.bootstrap_run()