コード例 #1
0
ファイル: core_test.py プロジェクト: SamuelMulder/oxide
 def test_create_collection(self):
     """ Assert that a collection can be created """
     oid_list = ["abc"]
     data = {"xyz":"lmn"}
     opts = {}
     oxide.store("files", oid_list[0], data, opts)
     col_name = "test"
     self.assertTrue(oxide.create_collection(col_name, oid_list, "notes"), "Collection creation failed.")
     cid_l = oxide.get_cid_from_oid_list(oid_list)
     cid_n = oxide.get_cid_from_name(col_name)
     self.failUnlessEqual(cid_l, cid_n, "cid collection name mismatch.")
コード例 #2
0
ファイル: core_test.py プロジェクト: SamuelMulder/oxide
 def test_store_exists_retrieve_delete(self):
     """ Exercise the oxide functions store, exists, retrieve and delete_data """
     mod_name = "files"
     oid = "abc"
     data = {"xyz":"lmn"}
     opts = {}
     self.assertNotEqual(oxide.store(mod_name, oid, data, opts), False, "Store attempt failed.")
     self.assertNotEqual(oxide.exists(mod_name, oid, opts), False, "Test for data exists failed.")
     self.assertNotEqual(oxide.retrieve(mod_name, oid, opts, lock=False), False, "Retrieve attempt failed.")