aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2022-08-31 21:24:12 +0100
committerMichael Williamson <mike@zwobble.org>2022-08-31 21:24:12 +0100
commit2dee4de65d6f94da7c46a484716ab504d356a0be (patch)
treed680694b572de133404fd3a498ce60c116ba01d6
parent9b71a403e748db28b24637164cfa1155ad078396 (diff)
Use precisely instead of PyHamcrest
-rw-r--r--test-requirements.txt1
-rw-r--r--tests/images_tests.py10
-rw-r--r--tests/styles/parser/tokeniser_tests.py6
3 files changed, 8 insertions, 9 deletions
diff --git a/test-requirements.txt b/test-requirements.txt
index 25077c3..208ed8d 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -4,5 +4,4 @@ spur.local>=0.3.7,<0.4
tempman>=0.1.2,<0.2
pyflakes==2.4.0
nose-parameterized==0.5.0
-PyHamcrest==1.9.0
precisely==0.1.3
diff --git a/tests/images_tests.py b/tests/images_tests.py
index cf2e284..508d141 100644
--- a/tests/images_tests.py
+++ b/tests/images_tests.py
@@ -1,7 +1,7 @@
import io
-from hamcrest import assert_that, contains, has_properties
from nose.tools import istest
+from precisely import assert_that, has_attrs, is_sequence
import mammoth
@@ -19,9 +19,9 @@ def data_uri_encodes_images_in_base64():
content_type="image/jpeg",
open=lambda: io.BytesIO(image_bytes),
)
-
+
result = mammoth.images.data_uri(image)
-
- assert_that(result, contains(
- has_properties(attributes={"src": "data:image/jpeg;base64,YWJj"}),
+
+ assert_that(result, is_sequence(
+ has_attrs(attributes={"src": "data:image/jpeg;base64,YWJj"}),
))
diff --git a/tests/styles/parser/tokeniser_tests.py b/tests/styles/parser/tokeniser_tests.py
index e8c3c7b..482c5b0 100644
--- a/tests/styles/parser/tokeniser_tests.py
+++ b/tests/styles/parser/tokeniser_tests.py
@@ -1,4 +1,4 @@
-from hamcrest import assert_that, contains, has_properties
+from precisely import assert_that, has_attrs, is_sequence
from mammoth.styles.parser.tokeniser import tokenise
@@ -98,12 +98,12 @@ def assert_tokens(string, *expected):
expected.append(is_token("end", ""))
assert_that(
tokenise(string),
- contains(*expected),
+ is_sequence(*expected),
)
def is_token(token_type, value):
- return has_properties(
+ return has_attrs(
type=token_type,
value=value,
)