Instead of declaring the create_from_request_pdu and create_from_response_pdu factory methods as @staticmethod, use @classmethod. Then the class is passed to the method as the cls parameter, which can be used to instantiate an instance, rather than hardcoding the class name.
This allows the function classes to be subclassed without having to reimplement the factory methods just to change the class name.
Coverage remained the same at 95.824% when pulling ba7c73b0e5a3de18cd235a9b6998e11f3abffe53 on rgov:rzg/fix_factory_methods into 0faaf904f67327ebdff89b936d5c06a801ad7da7 on AdvancedClimateSystems:master.
Instead of declaring the
create_from_request_pdu
andcreate_from_response_pdu
factory methods as@staticmethod
, use@classmethod
. Then the class is passed to the method as thecls
parameter, which can be used to instantiate an instance, rather than hardcoding the class name.This allows the function classes to be subclassed without having to reimplement the factory methods just to change the class name.
Also fixes up some comments that were incorrect.