def test_build_message(self, mock_get_uuid, mock_get_timestamp):
        mock_get_uuid.return_value = MOCK_UUID
        mock_get_timestamp.return_value = "2012-03-15T06:51:08Z"
        expected_message = FileUtilities.get_file_string(
            str(self.expected_message_dir / EXPECTED_EBXML))

        message_id, message = self.builder.build_message({
            FROM_PARTY_ID:
            "TESTGEN-201324",
            TO_PARTY_ID:
            "YEA-0000806",
            CPA_ID:
            "S1001A1630",
            CONVERSATION_ID:
            "79F49A34-9798-404C-AEC4-FD38DD81C138",
            SERVICE:
            "urn:nhs:names:services:pdsquery",
            ACTION:
            "QUPA_IN000006UK02",
            DUPLICATE_ELIMINATION:
            True,
            ACK_REQUESTED:
            True,
            ACK_SOAP_ACTOR:
            "urn:oasis:names:tc:ebxml-msg:actor:toPartyMSH",
            SYNC_REPLY:
            True,
            MESSAGE:
            '<QUPA_IN000006UK02 xmlns="urn:hl7-org:v3"></QUPA_IN000006UK02>'
        })

        # Pystache does not convert line endings to LF in the same way as Python does when loading the example from
        # file, so normalize the line endings of both strings
        normalized_expected_message = FileUtilities.normalize_line_endings(
            expected_message)
        normalized_message = FileUtilities.normalize_line_endings(message)

        self.assertEqual(MOCK_UUID, message_id)
        self.assertEqual(normalized_expected_message, normalized_message)
    def test_normalize_line_endings(self):
        strings_to_test = {
            "CRLF": CR_LF_STRING,
            "CR": CR_STRING,
            "LF": LF_STRING,
            "Mixed": MIXED_STRING
        }

        for line_break_type, test_string in strings_to_test.items():
            message = line_break_type + " line endings should be normalized."

            with self.subTest(message):
                normalized_string = FileUtilities.normalize_line_endings(test_string)

                self.assertEqual(EXPECTED_NORMALIZED_STRING, normalized_string)