def test_create_document(self): collection_name = "example" response = create( "collection", { "name": collection_name, "id_key": "name", "ordering": "ordering", "attributes": [{ "name": "a", "type": "STRING" }, { "name": "b", "type": "STRING" }, { "name": "c", "type": "STRING" }] }) response = create( collection_name, { "name": "1", "ordering": "2", "attributes": { "a": "test1", "b": "test2", "c": "test3" } }) self.assertEqual(response["name"], "1") self.assertIn("attributes", response)
def test_create_index(self): collection_name = "example" response = create( "collection", { "name": collection_name, "id_key": "id", "ordering": "ordering", "attributes": [{ "name": "a", "type": "STRING" }, { "name": "b", "type": "STRING" }, { "name": "c", "type": "STRING" }] }) index = { "uid": str(uuid.uuid4()), "name": "index", "collection": { "id_key": "id", "name": collection_name }, "conditions": ["a", "b"] } create("index", index)
def test_create_http_signature_client_authorization(self): http_signature_client_authorization = { "type": "http_signature", "client_id": "testclientid", "public_key": "test-public-key", "client_scopes": [{ "collection_name": "collection1", "scope_type": "GET" }] } response = create("client_authorization", http_signature_client_authorization) print("{}".format(response))
def test_create_collection(self): collection_name = "example" response = create( "collection", { "name": collection_name, "id_key": "id", "ordering": "ordering", "attributes": [{ "name": "a", "type": "STRING" }, { "name": "b", "type": "STRING" }, { "name": "c", "type": "STRING" }] }) self.assertEqual(response["name"], collection_name)