MCPcopy Create free account
hub / github.com/slackapi/python-slack-sdk / test_parse

Method test_parse

tests/slack_sdk/models/test_blocks.py:50–73  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

48
49class BlockTests(unittest.TestCase):
50 def test_parse(self):
51 input = {
52 "type": "section",
53 "text": {
54 "type": "mrkdwn",
55 "text": "A message *with some bold text* and _some italicized text_.",
56 },
57 "unexpected_field": "test",
58 "unexpected_fields": [1, 2, 3],
59 "unexpected_object": {"something": "wrong"},
60 }
61 block = Block.parse(input)
62 self.assertIsNotNone(block)
63
64 self.assertDictEqual(
65 {
66 "type": "section",
67 "text": {
68 "type": "mrkdwn",
69 "text": "A message *with some bold text* and _some italicized text_.",
70 },
71 },
72 block.to_dict(),
73 )
74
75 def test_eq(self):
76 self.assertEqual(Block(), Block())

Callers

nothing calls this directly

Calls 2

parseMethod · 0.45
to_dictMethod · 0.45

Tested by

no test coverage detected