Example #1
0
 def test_single_single(self):
     has_section=False
     for info in walk_structure(BODY4, multipart=True):
         p(info)
         if info.section =='2.1':
             has_section = True
     self.assertTrue(has_section)
Example #2
0
 def test_single_single(self):
     has_section = False
     for info in walk_structure(BODY4, multipart=True):
         p(info)
         if info.section == '2.1':
             has_section = True
     self.assertTrue(has_section)
Example #3
0
 def test_gmail(self):
     sec_2 = False
     for info in walk_structure(BODY3, multipart=True):
         p(info)
         if info.section =='2':
             self.assertEqual(info.type, 'message')
             self.assertEqual(info.sub_type, 'rfc822')
             sec_2=True
     self.assertTrue(sec_2)
Example #4
0
 def test_gmail(self):
     sec_2 = False
     for info in walk_structure(BODY3, multipart=True):
         p(info)
         if info.section == '2':
             self.assertEqual(info.type, 'message')
             self.assertEqual(info.sub_type, 'rfc822')
             sec_2 = True
     self.assertTrue(sec_2)
Example #5
0
 def test_msg(self):
     sec_2=False
     sec_23=False
     for info in walk_structure(BODY2, multipart=True):
         p(info)
         if info.section =='2':
             self.assertTrue(info.type == 'multipart' or info.type == 'message')
             self.assertTrue(info.sub_type == 'mixed' or info.sub_type == 'rfc822' )
             sec_2=True
         if info.section =='2.3':
             self.assertEqual(info.type, 'image')
             self.assertEqual(info.sub_type, 'png')
             sec_23=True
     self.assertTrue(sec_2)
     self.assertTrue(sec_23)
Example #6
0
 def test(self):
     sec_2=False
     sec_122=False
     for info in walk_structure(BODY):
         p(info)
         if info.section =='2':
             self.assertEqual(info.type, 'text')
             self.assertEqual(info.sub_type, 'csv')
             sec_2=True
         if info.section =='1.2.2':
             self.assertEqual(info.type, 'image')
             self.assertEqual(info.sub_type, 'gif')
             sec_122=True
     self.assertTrue(sec_2)
     self.assertTrue(sec_122)
Example #7
0
 def test(self):
     sec_2 = False
     sec_122 = False
     for info in walk_structure(BODY):
         p(info)
         if info.section == '2':
             self.assertEqual(info.type, 'text')
             self.assertEqual(info.sub_type, 'csv')
             sec_2 = True
         if info.section == '1.2.2':
             self.assertEqual(info.type, 'image')
             self.assertEqual(info.sub_type, 'gif')
             sec_122 = True
     self.assertTrue(sec_2)
     self.assertTrue(sec_122)
Example #8
0
 def test_msg(self):
     sec_2 = False
     sec_23 = False
     for info in walk_structure(BODY2, multipart=True):
         p(info)
         if info.section == '2':
             self.assertTrue(info.type == 'multipart'
                             or info.type == 'message')
             self.assertTrue(info.sub_type == 'mixed'
                             or info.sub_type == 'rfc822')
             sec_2 = True
         if info.section == '2.3':
             self.assertEqual(info.type, 'image')
             self.assertEqual(info.sub_type, 'png')
             sec_23 = True
     self.assertTrue(sec_2)
     self.assertTrue(sec_23)