|
3 | 3 |
|
4 | 4 | from io import BytesIO
|
5 | 5 |
|
6 |
| -from hypothesis import given, strategies |
7 | 6 | import pytest
|
8 | 7 | from tests import base
|
9 | 8 |
|
@@ -43,20 +42,6 @@ def setUp(self):
|
43 | 42 | super().setUp()
|
44 | 43 | xmlsec.cleanup_callbacks()
|
45 | 44 |
|
46 |
| - @given(funcs=strategies.lists( |
47 |
| - strategies.sampled_from([ |
48 |
| - lambda: None |
49 |
| - # xmlsec.cleanup_callbacks, |
50 |
| - # xmlsec.register_default_callbacks, |
51 |
| - ]) |
52 |
| - )) |
53 |
| - def test_arbitrary_cleaning_and_default_callback_registration(self, funcs): |
54 |
| - # FIXME: This test seems to detelct unreferenced objects and memory |
55 |
| - # leaks even if it never does anything! |
56 |
| - pass |
57 |
| - # for f in funcs: |
58 |
| - # f() |
59 |
| - |
60 | 45 | def _sign_doc(self):
|
61 | 46 | root = self.load_xml("doc.xml")
|
62 | 47 | sign = xmlsec.template.create(
|
@@ -122,26 +107,20 @@ def test_sign_data_from_callbacks(self):
|
122 | 107 | self._register_match_callbacks()
|
123 | 108 | self._verify_external_data_signature()
|
124 | 109 |
|
125 |
| - @given( |
126 |
| - num_prior_mismatches=strategies.integers(min_value=1, max_value=50), |
127 |
| - num_post_mismatches=strategies.integers(min_value=1, max_value=50), |
128 |
| - ) |
129 |
| - def test_sign_data_not_first_callback( |
130 |
| - self, num_prior_mismatches, num_post_mismatches |
131 |
| - ): |
| 110 | + def test_sign_data_not_first_callback(self): |
132 | 111 | bad_match_calls = 0
|
133 | 112 |
|
134 | 113 | def match_cb(filename):
|
135 | 114 | nonlocal bad_match_calls
|
136 | 115 | bad_match_calls += 1
|
137 | 116 | False
|
138 | 117 |
|
139 |
| - for _ in range(num_post_mismatches): |
| 118 | + for _ in range(2): |
140 | 119 | self._register_mismatch_callbacks(match_cb)
|
141 | 120 |
|
142 | 121 | self._register_match_callbacks()
|
143 | 122 |
|
144 |
| - for _ in range(num_prior_mismatches): |
| 123 | + for _ in range(2): |
145 | 124 | self._register_mismatch_callbacks()
|
146 | 125 |
|
147 | 126 | self._verify_external_data_signature()
|
|
0 commit comments