def test_set_text_panel_content(self):
    panel_id = 42
    panel_content = 'My wonderful panel content'
    self.phab.dashboard.panel.edit.return_value = {'error': None, 'errorMessage': None, 'response': {'object': {'id': panel_id, 'phid': 'PHID-DSHP-123456789', 'transactions': [{'phid': 'PHID-XACT-DSHP-abcdefghi'}]}}}

    def call_set_text_panel_content():
        self.phab.set_text_panel_content(panel_id, panel_content)
        self.phab.dashboard.panel.edit.assert_called_with(objectIdentifier=panel_id, transactions=[{'type': 'text', 'value': panel_content}])
    call_set_text_panel_content()
    self.phab.dashboard.panel.edit.return_value['error'] = 'You shall not pass !'
    with self.assertRaisesRegex(AssertionError, 'Failed to edit panel'):
        call_set_text_panel_content()
def test_set_text_panel_content(self):
    panel_id = 42
    panel_content = 'My wonderful panel content'
    self.phab.dashboard.panel.edit.return_value = {'error': None, 'errorMessage': None, 'response': {'object': {'id': panel_id, 'phid': 'PHID-DSHP-123456789', 'transactions': [{'phid': 'PHID-XACT-DSHP-abcdefghi'}]}}}

    def call_set_text_panel_content():
        self.phab.set_text_panel_content(panel_id, panel_content)
        self.phab.dashboard.panel.edit.assert_called_with(objectIdentifier=panel_id, transactions=[{'type': 'text', 'value': panel_content}])
    call_set_text_panel_content()
    self.phab.dashboard.panel.edit.return_value['error'] = 'You shall not pass !'
    with self.assertRaisesRegex(AssertionError, 'Failed to edit panel'):
        call_set_text_panel_content()