diff options
Diffstat (limited to 'jarmon/jarmon.test.js')
-rw-r--r-- | jarmon/jarmon.test.js | 27 |
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 |