def test_info(self): e = GlusterException() self.assertEqual(e.info(), {'code': 4100, 'message': str(e), 'rc': e.rc, 'out': e.out, 'err': e.err})
def test_response(self): e = GlusterException() self.assertEqual(e.response(), {'status': e.info()})
def test_str_with_err(self): e = GlusterException(err=["error"]) self.assertEqual(str(e), "Gluster Exception\nerror: error")
def test_str_with_out_multiline(self): e = GlusterException(out=["line 1", "line 2", "line 3"]) self.assertEqual(str(e), "Gluster Exception\nerror: line 1\nline 2\n" "line 3")
def test_str_with_out(self): e = GlusterException(out=["output"]) self.assertEqual(str(e), "Gluster Exception\nerror: output")
def test_str_with_rc(self): e = GlusterException(rc=1) self.assertEqual(str(e), "Gluster Exception\nreturn code: 1")
def test_str(self): e = GlusterException() self.assertEqual(str(e), "Gluster Exception")