Ejemplo n.º 1
0
 def test_delete(self):
     for dataset_name in self.TEST_DATASETS:
         record = Dataset.save(self.test_dataset_ids[dataset_name])
         records = [x for x in \
                 Dataset.find(self.test_dataset_ids[dataset_name])]
         self.assertNotEqual(records, [])
         Dataset.delete(self.test_dataset_ids[dataset_name])
         records = [x for x in
                 Dataset.find(self.test_dataset_ids[dataset_name])]
         self.assertEqual(records, [])
Ejemplo n.º 2
0
 def test_find(self):
     for dataset_name in self.TEST_DATASETS:
         record = Dataset.save(self.test_dataset_ids[dataset_name])
         cursor = Dataset.find(self.test_dataset_ids[dataset_name])
         rows = [x for x in cursor]
         self.assertTrue(isinstance(cursor, Cursor))
         self.assertEqual(record, rows[0])
         self.assertEqual(record, Dataset.find_one(
                     self.test_dataset_ids[dataset_name]))