コード例 #1
0
ファイル: encoding_test.py プロジェクト: iurnah/python-maec
 def test_to_xml_no_encoding(self):
     b = Behavior()
     b.description = UNICODE_STR
     xml = b.to_xml(encoding=None)
     self.assertTrue(isinstance(xml, unicode))
     self.assertTrue(UNICODE_STR in xml)
コード例 #2
0
ファイル: encoding_test.py プロジェクト: iurnah/python-maec
 def test_to_xml_default_encoded(self):
     b = Behavior()
     b.description = UNICODE_STR
     xml = b.to_xml()
     self.assertTrue(UNICODE_STR in xml.decode('utf-8'))
コード例 #3
0
ファイル: encoding_test.py プロジェクト: iurnah/python-maec
 def test_to_xml_utf16_encoded(self):
     encoding = 'utf-16'
     b = Behavior()
     b.description = UNICODE_STR
     xml = b.to_xml(encoding=encoding)
     self.assertTrue(UNICODE_STR in xml.decode(encoding))
コード例 #4
0
 def test_to_xml_no_encoding(self):
     b = Behavior()
     b.description = UNICODE_STR
     xml = b.to_xml(encoding=None)
     self.assertTrue(isinstance(xml, text_type))
     self.assertTrue(UNICODE_STR in xml)
コード例 #5
0
 def test_to_xml_default_encoded(self):
     b = Behavior()
     b.description = UNICODE_STR
     xml = b.to_xml()
     self.assertTrue(UNICODE_STR in xml.decode('utf-8'))
コード例 #6
0
 def test_to_xml_utf16_encoded(self):
     encoding = 'utf-16'
     b = Behavior()
     b.description = UNICODE_STR
     xml = b.to_xml(encoding=encoding)
     self.assertTrue(UNICODE_STR in xml.decode(encoding))