MCPcopy Index your code
hub / github.com/python/cpython / test_hierarchy

Method test_hierarchy

Lib/test/test_email/test_email.py:1909–1925  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1907 self._txt = intro
1908
1909 def test_hierarchy(self):
1910 # convenience
1911 eq = self.assertEqual
1912 raises = self.assertRaises
1913 # tests
1914 m = self._msg
1915 self.assertTrue(m.is_multipart())
1916 eq(m.get_content_type(), 'multipart/mixed')
1917 eq(len(m.get_payload()), 2)
1918 raises(IndexError, m.get_payload, 2)
1919 m0 = m.get_payload(0)
1920 m1 = m.get_payload(1)
1921 self.assertIs(m0, self._txt)
1922 self.assertIs(m1, self._im)
1923 eq(m.get_payload(), [m0, m1])
1924 self.assertFalse(m0.is_multipart())
1925 self.assertFalse(m1.is_multipart())
1926
1927 def test_empty_multipart_idempotent(self):
1928 text = """\

Callers

nothing calls this directly

Calls 8

eqFunction · 0.85
raisesFunction · 0.85
assertTrueMethod · 0.80
is_multipartMethod · 0.80
get_content_typeMethod · 0.80
get_payloadMethod · 0.80
assertFalseMethod · 0.80
assertIsMethod · 0.45

Tested by

no test coverage detected