Example #1
0
 def test_append_bulk_calls_append(self):
     # given
     ts = TimeSeries()
     ts.append = Mock()      # override append method, which would throw NotImplementedError
     #when
     ts.append_bulk([[x] for x in range(0,3)])
     #then
     expected_calls = [ call([x]) for x in range(0,3)]
     assert_that(ts.append.mock_calls, is_(equal_to(expected_calls)))
Example #2
0
 def test_append_raises_NotImplementedError(self):
     ts = TimeSeries()
     assert_that(calling(lambda: ts.append([1])), raises(NotImplementedError))
Example #3
0
 def test_empty_range_returns_none(self):
     ts = TimeSeries()
     ts.rows = Mock(return_value=[])
     assert_that(ts.range(), is_(none()))