Skip to content

Commit 0a090fe

Browse files
authored
[client] enum value as "type" in make_struct_for_matching
Signed-off-by: Antoine MAZEAS <[email protected]>
1 parent fd1c949 commit 0a090fe

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pyobas/signatures/signature_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def __init__(
2222
# }
2323
def make_struct_for_matching(self, data):
2424
struct = {
25-
"type": self.match_policy.match_type,
25+
"type": self.match_policy.match_type.value,
2626
"data": data,
2727
}
2828

test/signatures/test_signature_type.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def test_make_struct_create_expected_struct_for_simple_sig_type(self):
1414
data = "just a simple string"
1515
simple_struct = simple_signature_type.make_struct_for_matching(data=data)
1616

17-
self.assertEqual(simple_struct.get("type"), MatchTypes.MATCH_TYPE_SIMPLE)
17+
self.assertEqual(simple_struct.get("type"), MatchTypes.MATCH_TYPE_SIMPLE.value)
1818
self.assertEqual(simple_struct.get("data"), data)
1919
self.assertFalse("score" in simple_struct.keys())
2020

@@ -30,7 +30,7 @@ def test_make_struct_create_expected_struct_for_fuzzy_sig_type(self):
3030
data = "just another simple string"
3131
simple_struct = fuzzy_signature_type.make_struct_for_matching(data=data)
3232

33-
self.assertEqual(simple_struct.get("type"), MatchTypes.MATCH_TYPE_FUZZY)
33+
self.assertEqual(simple_struct.get("type"), MatchTypes.MATCH_TYPE_FUZZY.value)
3434
self.assertEqual(simple_struct.get("data"), data)
3535
self.assertEqual(simple_struct.get("score"), fuzzy_signature_type_score)
3636

@@ -48,7 +48,7 @@ def test_make_struct_create_expected_struct_for_fuzzy_sig_type_when_score_is_0(
4848
data = "just another simple string"
4949
simple_struct = fuzzy_signature_type.make_struct_for_matching(data=data)
5050

51-
self.assertEqual(simple_struct.get("type"), MatchTypes.MATCH_TYPE_FUZZY)
51+
self.assertEqual(simple_struct.get("type"), MatchTypes.MATCH_TYPE_FUZZY.value)
5252
self.assertEqual(simple_struct.get("data"), data)
5353
self.assertEqual(simple_struct.get("score"), fuzzy_signature_type_score)
5454

0 commit comments

Comments
 (0)