Esempio n. 1
0
 def test_table_rows_iterator(self):
   fields = self.make_fields()
   table_name = 'foo-%s.h5' % time.time()
   N = 16
   pc = ProxyCore(OME_HOST, OME_USER, OME_PASS)
   pc.create_table(table_name, fields)
   data = self.fill_table(pc, table_name, N)
   row_it = pc.get_table_rows_iterator(table_name)
   for i, row in enumerate(row_it):
     self.assertTrue(row == data[i])
   pc.delete_table(table_name)
Esempio n. 2
0
 def test_table_rows_iterator(self):
     fields = self.make_fields()
     table_name = 'foo-%s.h5' % time.time()
     N = 16
     pc = ProxyCore(OME_HOST, OME_USER, OME_PASS)
     pc.create_table(table_name, fields)
     data = self.fill_table(pc, table_name, N)
     row_it = pc.get_table_rows_iterator(table_name)
     for i, row in enumerate(row_it):
         self.assertTrue(row == data[i])
     pc.delete_table(table_name)
Esempio n. 3
0
 def test_create_delete(self):
   fields = self.make_fields()
   table_name = 'foo-%s.h5' % time.time()
   pc = ProxyCore(OME_HOST, OME_USER, OME_PASS)
   pc.create_table(table_name, fields)
   rec_desc = pc.get_table_headers(table_name)
   for f, n in it.izip(fields, rec_desc):
     self.assertEqual(f[1], n[0])
     if f[0] == 'string':
       self.assertEqual('|S%d' % f[3], n[1])
     elif f[0] == 'long':
       self.assertEqual('i8', n[1])
   pc.delete_table(table_name)
Esempio n. 4
0
 def test_create_delete(self):
     fields = self.make_fields()
     table_name = 'foo-%s.h5' % time.time()
     pc = ProxyCore(OME_HOST, OME_USER, OME_PASS)
     pc.create_table(table_name, fields)
     rec_desc = pc.get_table_headers(table_name)
     for f, n in it.izip(fields, rec_desc):
         self.assertEqual(f[1], n[0])
         if f[0] == 'string':
             self.assertEqual('|S%d' % f[3], n[1])
         elif f[0] == 'long':
             self.assertEqual('i8', n[1])
     pc.delete_table(table_name)
Esempio n. 5
0
 def test_table_rows(self):
   fields = self.make_fields()
   table_name = 'foo-%s.h5' % time.time()
   N = 16
   pc = ProxyCore(OME_HOST, OME_USER, OME_PASS)
   pc.create_table(table_name, fields)
   data = self.fill_table(pc, table_name, N)
   r = pc.get_table_rows(table_name, None)
   self.assertTrue(np.all(data == r))
   m = N/2
   r = pc.get_table_rows(table_name, '(r_vid == "%s")' % data[m]['r_vid'])
   self.assertEqual(len(r), 1)
   self.assertTrue(data[m] == r[0])
   pc.delete_table(table_name)
Esempio n. 6
0
 def test_table_rows(self):
     fields = self.make_fields()
     table_name = 'foo-%s.h5' % time.time()
     N = 16
     pc = ProxyCore(OME_HOST, OME_USER, OME_PASS)
     pc.create_table(table_name, fields)
     data = self.fill_table(pc, table_name, N)
     r = pc.get_table_rows(table_name, None)
     self.assertTrue(np.all(data == r))
     m = N / 2
     r = pc.get_table_rows(table_name, '(r_vid == "%s")' % data[m]['r_vid'])
     self.assertEqual(len(r), 1)
     self.assertTrue(data[m] == r[0])
     pc.delete_table(table_name)