|
| 1 | +// Copyright 2015, Google, Inc. |
| 2 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | +// you may not use this file except in compliance with the License. |
| 4 | +// You may obtain a copy of the License at |
| 5 | +// |
| 6 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | +// |
| 8 | +// Unless required by applicable law or agreed to in writing, software |
| 9 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | +// See the License for the specific language governing permissions and |
| 12 | +// limitations under the License. |
| 13 | + |
| 14 | +'use strict'; |
| 15 | + |
| 16 | +var Entity = require('../../datastore/concepts').Entity; |
| 17 | +var entity; |
| 18 | + |
| 19 | +describe('datastore/concepts/entity', function () { |
| 20 | + before(function() { |
| 21 | + var projectId = process.env.TEST_PROJECT_ID || 'nodejs-docs-samples'; |
| 22 | + entity = new Entity(projectId); |
| 23 | + }); |
| 24 | + |
| 25 | + describe('incomplete key', function() { |
| 26 | + it('saves with an incomplete key', function(done) { |
| 27 | + entity.testIncompleteKey(done); |
| 28 | + }); |
| 29 | + }); |
| 30 | + |
| 31 | + describe('testNamedKey', function() { |
| 32 | + it('saves with a named key', function(done) { |
| 33 | + entity.testNamedKey(done); |
| 34 | + }); |
| 35 | + }); |
| 36 | + |
| 37 | + describe('testKeyWithParent', function() { |
| 38 | + it('saves a key with a parent', function(done) { |
| 39 | + entity.testKeyWithParent(done); |
| 40 | + }); |
| 41 | + }); |
| 42 | + |
| 43 | + describe('testKeyWithMultiLevelParent', function() { |
| 44 | + it('saves a key with multiple parents', function(done) { |
| 45 | + entity.testKeyWithMultiLevelParent(done); |
| 46 | + }); |
| 47 | + }); |
| 48 | + |
| 49 | + describe('testEntityWithParent', function() { |
| 50 | + it('saves an entity with a parent', function(done) { |
| 51 | + entity.testEntityWithParent(done); |
| 52 | + }); |
| 53 | + }); |
| 54 | + |
| 55 | + describe('testProperties', function() { |
| 56 | + it('saves an entity with properties', function(done) { |
| 57 | + entity.testProperties(done); |
| 58 | + }); |
| 59 | + }); |
| 60 | + |
| 61 | + describe('testArrayValue', function() { |
| 62 | + it('saves an entity with arrays', function(done) { |
| 63 | + entity.testArrayValue(done); |
| 64 | + }); |
| 65 | + }); |
| 66 | + |
| 67 | + describe('testBasicEntity', function() { |
| 68 | + it('saves a basic entity', function(done) { |
| 69 | + entity.testBasicEntity(done); |
| 70 | + }); |
| 71 | + }); |
| 72 | + |
| 73 | + describe('testUpsert', function() { |
| 74 | + it('saves with an upsert', function(done) { |
| 75 | + entity.testUpsert(done); |
| 76 | + }); |
| 77 | + }); |
| 78 | + |
| 79 | + describe('testInsert', function() { |
| 80 | + it('saves with an insert', function(done) { |
| 81 | + entity.testInsert(done); |
| 82 | + }); |
| 83 | + }); |
| 84 | + |
| 85 | + describe('testLookup', function() { |
| 86 | + it('performs a lookup', function(done) { |
| 87 | + entity.testLookup(done); |
| 88 | + }); |
| 89 | + }); |
| 90 | + |
| 91 | + describe('testUpdate', function() { |
| 92 | + it('saves with an update', function(done) { |
| 93 | + entity.testUpdate(done); |
| 94 | + }); |
| 95 | + }); |
| 96 | + |
| 97 | + describe('testDelete', function() { |
| 98 | + it('deletes an entity', function(done) { |
| 99 | + entity.testDelete(done); |
| 100 | + }); |
| 101 | + }); |
| 102 | + |
| 103 | + describe('testBatchUpsert', function() { |
| 104 | + it('performs a batch upsert', function(done) { |
| 105 | + entity.testBatchUpsert(done); |
| 106 | + }); |
| 107 | + }); |
| 108 | + |
| 109 | + describe('testBatchLookup', function() { |
| 110 | + it('performs a batch lookup', function(done) { |
| 111 | + entity.testBatchLookup(done); |
| 112 | + }); |
| 113 | + }); |
| 114 | + |
| 115 | + describe('testBatchDelete', function() { |
| 116 | + it('performs a batch delete', function(done) { |
| 117 | + entity.testBatchDelete(done); |
| 118 | + }); |
| 119 | + }); |
| 120 | +}); |
0 commit comments