Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

putItem test

  • Loading branch information...
commit 236aad0feefad9844548c4fde76e996ee3c4d347 1 parent 36f7af3
@rjrodger authored
Showing with 47 additions and 5 deletions.
  1. +17 −4 package.json
  2. +30 −1 test/simpledb.test.js
View
21 package.json
@@ -1,7 +1,14 @@
{
"name": "simpledb",
"description": "An Amazon AWS SimpleDB library for Node.js that is user-friendly and fault-tolerant",
- "keywords": ["amazon","aws","simpledb","database","wrapper","api"],
+ "keywords": [
+ "amazon",
+ "aws",
+ "simpledb",
+ "database",
+ "wrapper",
+ "api"
+ ],
"version": "0.0.8",
"homepage": "https://github.com/rjrodger/simpledb",
"author": "Richard Rodger <richard@ricebridge.com> (http://richardrodger.com/)",
@@ -10,14 +17,20 @@
"John Roberts <jroberts@logitech.com>"
],
"dependencies": {
- "aws-lib": "0.0.5"
+ "aws-lib": "0.0.5"
},
"main": "lib/simpledb",
"directories": {
"lib": "lib"
},
- "repository": { "type" : "git", "url" : "https://github.com/rjrodger/simpledb.git" },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/rjrodger/simpledb.git"
+ },
"engines": {
"node": "*"
+ },
+ "devDependencies": {
+ "nid": "~0.3.0"
}
-}
+}
View
31 test/simpledb.test.js
@@ -1,9 +1,12 @@
-/* Copyright (c) 2011 Richard Rodger */
+/* Copyright (c) 2011-2013 Richard Rodger, BSD License */
var util = require('util')
var assert = require('assert')
+
var eyes = require('eyes')
+var nid = require('nid')
+
var simpledb = require('../lib/simpledb.js')
@@ -463,6 +466,32 @@ module.exports = {
})
})
})
+ },
+
+ putItemHappy: function() {
+ var keys = require('./keys.mine.js')
+ sdb = new simpledb.SimpleDB({keyid:keys.id,secret:keys.secret,host:keys.host||awshost})//,simpledb.debuglogger)
+
+ var itemid = nid()
+
+ sdb.createDomain( 'yourdomain', function( error ) {
+
+ sdb.putItem('yourdomain', 'put-'+itemid, {field1:'one'}, function( error ) {
+ sdb.getItem('yourdomain', 'put-'+itemid, function( error, result ) {
+ //console.dir(result)
+ //console.log( 'field1 = '+result.field1 )
+ assert.equal(result.field1, 'one')
+
+ sdb.putItem('yourdomain', 'put-'+itemid, {field1:'ONE'}, function( error ) {
+ sdb.getItem('yourdomain', 'put-'+itemid, function( error, result ) {
+ //console.dir(result)
+ //console.log( 'field1 = '+result.field1 )
+ assert.equal(result.field1, 'ONE')
+ })
+ })
+ })
+ })
+ })
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.