Beispiel #1
0
 def __write_status_element(self, success=True, error_msg=''):
     e = ElementMaker.create_status_element(success, error_msg)
     if self.__pretty_formatting:
         self.__out.write(',\n { "')
     else:
         self.__out.write(',{"')
     self.__out.write(e.get_name())
     self.__out.write('": ')
     self.__out.write(self.__aspect_element_to_json(e))
     self.__out.write(' }')
Beispiel #2
0
 def __write_status_element(self, success=True, error_msg=''):
     e = ElementMaker.create_status_element(success,error_msg)
     if self.__pretty_formatting:
         self.__out.write(',\n { "')
     else:
         self.__out.write(',{"')
     self.__out.write(e.get_name())
     self.__out.write('": ')
     self.__out.write(self.__aspect_element_to_json(e))
     self.__out.write(' }')
Beispiel #3
0
 def test_4(self):
     e = ElementMaker.create_status_element(True, "msg")
     self.assertEquals(e.get_name(), CxConstants.STATUS)
     d = e.get_data()[0]
     self.assertEquals(d['success'], True)
     self.assertEquals(d['error'], 'msg')
Beispiel #4
0
 def test_4(self):
     e = ElementMaker.create_status_element(True, "msg")
     self.assertEquals(e.get_name(), CxConstants.STATUS)
     d = e.get_data()[0]
     self.assertEquals(d['success'], True)
     self.assertEquals(d['error'], 'msg')