mirror of
https://github.com/mandiant/capa.git
synced 2025-12-23 07:28:34 -08:00
pep8
This commit is contained in:
@@ -744,5 +744,6 @@ def main(argv=None):
|
|||||||
|
|
||||||
print(proto_doc)
|
print(proto_doc)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
@@ -319,14 +319,18 @@ def assert_round_trip(doc: rd.ResultDocument):
|
|||||||
# which works thanks to pydantic model equality.
|
# which works thanks to pydantic model equality.
|
||||||
assert one == two
|
assert one == two
|
||||||
# second by showing their protobuf representations are the same.
|
# 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.
|
# now show that two different versions are not equal.
|
||||||
three = copy.deepcopy(two)
|
three = copy.deepcopy(two)
|
||||||
three.meta.__dict__.update({"version": "0.0.0"})
|
three.meta.__dict__.update({"version": "0.0.0"})
|
||||||
assert one.meta.version != three.meta.version
|
assert one.meta.version != three.meta.version
|
||||||
assert one != three
|
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(
|
@pytest.mark.parametrize(
|
||||||
|
|||||||
Reference in New Issue
Block a user