def test_create_r_with_error(self): dss = [ 'DS:a:WRONG:120:0:U', ] with self.assertRaisesRegexp(error, 'invalid DS type specified'): create_r('/tmp/foo', 10, time_ref, dss)
def test_create_r(self): dss = [ 'DS:a:GAUGE:120:0:U', 'DS:b:GAUGE:120:0:U' ] rras = [ 'RRA:AVERAGE:0.5:1:100', 'RRA:AVERAGE:0.5:10:1000' ] create_r('/tmp/foo', 10, time_ref, dss, rras) self.assertTrue(os.path.isfile('/tmp/foo'))