def failure_reply_xml(self, obj, failure_flag, d1, msg, d3, prev_state,
                          debug_msg=None, debug_args=None, mock_info=None,
                          mock_debug=None, *args):
        # Mock the reactor as we don;t want to make an actual call
        main.reactor.callLater = mock.MagicMock()

        # Calculate the expected state of fsm using prev_state and
        # status flag
        expected_state = self.mock_JunoscriptRpc.fsm.\
            transitions[prev_state, failure_flag]

        self.mock_JunoscriptRpc.updateStatus.\
            assert_called_with(d1, msg, d3)
        if mock_info:
            mock_info.assert_any_call(*args)
        if mock_debug:
            mock_debug(debug_msg, debug_args)

        # Check if the calculated state and state the fsm actually transitions
        # into are equal
        self.assertEqual(expected_state[0], self.mock_JunoscriptRpc.fsm.state)
This method is used to parse an existing datagram into its
dataset/ETHPy150Open facebook/fbpush/tests/test_push.py/FBPushJunoscriptRpcTestCase.failure_reply_xml--crossover with--dataset/ETHPy150Open msoulier/tftpy/tftpy/TftpPacketFactory.py/TftpPacketFactory.parse