diff --git a/capa/render/proto/__init__.py b/capa/render/proto/__init__.py index d8c3efd4..c937f8de 100644 --- a/capa/render/proto/__init__.py +++ b/capa/render/proto/__init__.py @@ -744,5 +744,6 @@ def main(argv=None): print(proto_doc) + if __name__ == "__main__": main() diff --git a/tests/test_proto.py b/tests/test_proto.py index ab0b7ed3..64c950bc 100644 --- a/tests/test_proto.py +++ b/tests/test_proto.py @@ -319,14 +319,18 @@ def assert_round_trip(doc: rd.ResultDocument): # which works thanks to pydantic model equality. assert one == two # second by showing their protobuf representations are the same. - assert capa.render.proto.doc_to_pb2(one).SerializeToString(deterministic=True) == capa.render.proto.doc_to_pb2(two).SerializeToString(deterministic=True) + assert capa.render.proto.doc_to_pb2(one).SerializeToString(deterministic=True) == capa.render.proto.doc_to_pb2( + two + ).SerializeToString(deterministic=True) # now show that two different versions are not equal. three = copy.deepcopy(two) three.meta.__dict__.update({"version": "0.0.0"}) assert one.meta.version != three.meta.version assert one != three - assert capa.render.proto.doc_to_pb2(one).SerializeToString(deterministic=True) != capa.render.proto.doc_to_pb2(three).SerializeToString(deterministic=True) + assert capa.render.proto.doc_to_pb2(one).SerializeToString(deterministic=True) != capa.render.proto.doc_to_pb2( + three + ).SerializeToString(deterministic=True) @pytest.mark.parametrize(