summaryrefslogtreecommitdiff
path: root/jarmon/jarmon.test.js
diff options
context:
space:
mode:
authorRichard Wall <richard@largo>2010-09-02 23:52:25 +0100
committerRichard Wall <richard@largo>2010-09-02 23:52:25 +0100
commitddfdbf0e40aa2a9ac7f48520829dc6b30ff3c02b (patch)
tree7dd6d9ab6a3f9e7678543233637c0f0ddf302b2a /jarmon/jarmon.test.js
parentd3925d12f03b48581ebc4464d9ed82e32acea865 (diff)
Add test for unknown consolidation function error
Diffstat (limited to 'jarmon/jarmon.test.js')
-rw-r--r--jarmon/jarmon.test.js27
1 files changed, 25 insertions, 2 deletions
diff --git a/jarmon/jarmon.test.js b/jarmon/jarmon.test.js
index 7bffb1b..9e8eaca 100644
--- a/jarmon/jarmon.test.js
+++ b/jarmon/jarmon.test.js
@@ -171,19 +171,42 @@ YUI({ logInclude: { TestRunner: true } }).use('console', 'test', function(Y) {
this.d.addCallback(
function(self, rrd) {
self.resume(function() {
- var rq = new jarmon.RrdQuery(self.rrd, '');
+ var rq = new jarmon.RrdQuery(rrd, '');
var error = null;
try {
rq.getData(1, 0);
} catch(e) {
error = e;
}
- Y.Assert.isInstanceOf(jarmon.TimeRangeError, error);
+ Y.Assert.isInstanceOf(RangeError, error);
});
}, this);
this.wait();
},
+
+ test_getDataUnknownCfError: function () {
+ /**
+ * Error is raised if the rrd file doesn't contain an RRA with the
+ * requested consolidation function (CF)
+ **/
+ this.d.addCallback(
+ function(self, rrd) {
+ self.resume(function() {
+ var rq = new jarmon.RrdQuery(rrd, '');
+ var error = null;
+ try {
+ rq.getData(RRD_STARTTIME, RRD_ENDTIME, 0, 'FOO');
+ } catch(e) {
+ error = e;
+ }
+ Y.Assert.isInstanceOf(TypeError, error);
+ });
+ }, this);
+ this.wait();
+ },
+
+
test_getData: function () {
/**
* The generated rrd file should have values 0-9 at 300s intervals