def test_receiver(self): for receiver_name, receiver in zip(_test_receiver_names, self.test_receivers): header_contents = messages.generate_messages_header(receiver) self.assertGeneratedFileContentsEqual( header_contents, os.path.join(tests_directory, '{}Messages.h'.format(receiver_name))) implementation_contents = messages.generate_message_handler( receiver) self.assertGeneratedFileContentsEqual( implementation_contents, os.path.join(tests_directory, '{}MessageReceiver.cpp'.format(receiver_name)))
def assertHeaderEqual(self, input_messages_file_contents, expected_file_name): actual_file_contents = messages.generate_messages_header(StringIO(input_messages_file_contents)) self.assertGeneratedFileContentsEqual(actual_file_contents, expected_file_name)