File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -139,12 +139,16 @@ class _MarkerFinder(object):
139139 """
140140 Service class that knows how to find the next JFIF marker in a stream.
141141 """
142+ def __init__ (self , stream ):
143+ super (_MarkerFinder , self ).__init__ ()
144+ self ._stream = stream
145+
142146 @classmethod
143147 def from_stream (cls , stream ):
144148 """
145149 Return a |_MarkerFinder| instance to find JFIF markers in *stream*.
146150 """
147- raise NotImplementedError
151+ return cls ( stream )
148152
149153 def next (self , start ):
150154 """
Original file line number Diff line number Diff line change @@ -151,6 +151,29 @@ def stream_(self, request):
151151 return instance_mock (request , BytesIO )
152152
153153
154+ class Describe_MarkerFinder (object ):
155+
156+ def it_can_construct_from_a_stream (self , from_stream_fixture ):
157+ stream_ , _MarkerFinder__init_ = from_stream_fixture
158+ marker_finder = _MarkerFinder .from_stream (stream_ )
159+ _MarkerFinder__init_ .assert_called_once_with (stream_ )
160+ assert isinstance (marker_finder , _MarkerFinder )
161+
162+ # fixtures -------------------------------------------------------
163+
164+ @pytest .fixture
165+ def from_stream_fixture (self , stream_ , _MarkerFinder__init_ ):
166+ return stream_ , _MarkerFinder__init_
167+
168+ @pytest .fixture
169+ def _MarkerFinder__init_ (self , request ):
170+ return initializer_mock (request , _MarkerFinder )
171+
172+ @pytest .fixture
173+ def stream_ (self , request ):
174+ return instance_mock (request , BytesIO )
175+
176+
154177class Describe_MarkerParser (object ):
155178
156179 def it_can_construct_from_a_jfif_stream (self , from_stream_fixture ):
You can’t perform that action at this time.
0 commit comments