Ejemplo n.º 1
0
 def setUp(self):
     db.DB_NAME = 'test.db'
     db.first_time_setup()
     self.conn = sqlite3.connect('test.db')
     self.c = self.conn.cursor()
     self.user = user.User()
     self.inv = invoice.Invoice('some project', new=True, rate=20.0, rounding=1.0)
Ejemplo n.º 2
0
 def run(self):
     _install.run(self)
     if not db.db_exists():
         DB_DIR = os.path.expanduser('~/.gitime')
         if not os.path.exists(DB_DIR):
             os.makedirs(DB_DIR)
             if os.name in ('posix', 'mac'):
                 db.set_unix_permissions(DB_DIR)
         db.first_time_setup()
Ejemplo n.º 3
0
def reset_main(args):
    if not args.force:
        if raw_input(textwrap.fill((
            "WARNING: This will delete all invoices, commit logs, and user "
            "preferences. Your git repos won't be affected. You should export "
            "your invoices first. Are you sure? [y/N] "), 80)
        ) not in ('y', 'Y'):
            sys.exit()
    else:
        db.first_time_setup()
Ejemplo n.º 4
0
 def setUp(self):
     db.DB_NAME = 'test.db'
     db.first_time_setup()
     self.conn = sqlite3.connect('test.db')
     self.c = self.conn.cursor()
     self.user = user.User()
Ejemplo n.º 5
0
 def setUp(self):
     db.DB_NAME = 'test.db'
     db.first_time_setup()
     self.user = user.User()
     # make the time static so we can test it
     user.unix_now = lambda: 1405287929