Exemplo n.º 1
0
 def test_info(self):
     e = GlusterException()
     self.assertEqual(e.info(), {'code': 4100,
                                 'message': str(e),
                                 'rc': e.rc,
                                 'out': e.out,
                                 'err': e.err})
Exemplo n.º 2
0
 def test_response(self):
     e = GlusterException()
     self.assertEqual(e.response(), {'status': e.info()})
Exemplo n.º 3
0
 def test_str_with_err(self):
     e = GlusterException(err=["error"])
     self.assertEqual(str(e), "Gluster Exception\nerror: error")
Exemplo n.º 4
0
 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")
Exemplo n.º 5
0
 def test_str_with_out(self):
     e = GlusterException(out=["output"])
     self.assertEqual(str(e), "Gluster Exception\nerror: output")
Exemplo n.º 6
0
 def test_str_with_rc(self):
     e = GlusterException(rc=1)
     self.assertEqual(str(e), "Gluster Exception\nreturn code: 1")
Exemplo n.º 7
0
 def test_str(self):
     e = GlusterException()
     self.assertEqual(str(e), "Gluster Exception")