def test_receiver_implementation(self):
        file_contents = messages.generate_message_handler(StringIO(_messages_file_contents))
        self.assertGeneratedFileContentsEqual(file_contents, _expected_receiver_implementation)

        legacy_file_contents = messages.generate_message_handler(StringIO(_legacy_messages_file_contents))
        self.assertGeneratedFileContentsEqual(legacy_file_contents, _expected_legacy_receiver_implementation)

        superclass_file_contents = messages.generate_message_handler(StringIO(_superclass_messages_file_contents))
        self.assertGeneratedFileContentsEqual(superclass_file_contents, _expected_superclass_receiver_implementation)
Esempio n. 2
0
    def test_receiver_implementation(self):
        file_contents = messages.generate_message_handler(
            StringIO(_messages_file_contents))
        self.assertGeneratedFileContentsEqual(
            file_contents, _expected_receiver_implementation)

        legacy_file_contents = messages.generate_message_handler(
            StringIO(_legacy_messages_file_contents))
        self.assertGeneratedFileContentsEqual(
            legacy_file_contents, _expected_legacy_receiver_implementation)

        superclass_file_contents = messages.generate_message_handler(
            StringIO(_superclass_messages_file_contents))
        self.assertGeneratedFileContentsEqual(
            superclass_file_contents,
            _expected_superclass_receiver_implementation)
Esempio n. 3
0
 def test_error_at_elif(self):
     with self.assertRaisesRegexp(
             Exception,
             r"ERROR: '#elif.*' is not supported in the \*\.in files"):
         messages.generate_message_handler(StringIO("asd\n#elif bla\nfoo"))
 def test_error_at_elif(self):
     with self.assertRaisesRegexp(Exception, r"ERROR: '#elif.*' is not supported in the \*\.in files"):
         messages.generate_message_handler(StringIO("asd\n#elif bla\nfoo"))