Ejemplo n.º 1
0
 def test_execute_3(self):
     self.assertTrue(
         pg_batch.execute(self.host,
                          self.user,
                          self.port,
                          self.password,
                          self.database,
                          action='delete',
                          table='batch_test',
                          where='date IS NULL',
                          no_confirm=True,
                          read_batch_size=35,
                          write_batch_size=18))
Ejemplo n.º 2
0
 def test_execute_2(self):
     with unittest.mock.patch('builtins.input', return_value='yes'):
         self.assertTrue(
             pg_batch.execute(self.host,
                              self.user,
                              self.port,
                              self.password,
                              self.database,
                              action='update',
                              table='batch_test',
                              where='date IS NULL',
                              set_='date=NOW()',
                              read_batch_size=35,
                              write_batch_size=15))