Beispiel #1
0
 def test_new_changelog_topic__window_expires(self, *, table):
     table.window = Mock(name='window', autospec=Window)
     table.window.expires = 3600.3
     assert table._new_changelog_topic(retention=None).retention == 3600.3
Beispiel #2
0
 def test_contribute_to_stream(self, *, table):
     table.contribute_to_stream(Mock(name='stream', autospec=Stream))
Beispiel #3
0
 async def test_remove_from_stream(self, *, table):
     await table.remove_from_stream(Mock(name='stream', autospec=Stream))
Beispiel #4
0
 def test_combine(self, *, table):
     with pytest.raises(NotImplementedError):
         table.combine(Mock(name='joinable', autospec=Stream))
Beispiel #5
0
 def test__join(self, *, table):
     with pytest.raises(NotImplementedError):
         table._join(Mock(name='join_strategy', autospec=joins.Join))
Beispiel #6
0
 def test_should_expire_keys(self, *, table):
     table.window = None
     assert not table._should_expire_keys()
     table.window = Mock(name='window', autospec=Window)
     table.window.expires = 3600
     assert table._should_expire_keys()
Beispiel #7
0
 def test_table_metadata(self, *, router, app, assignor):
     table = app.tables["foo"] = Mock(name="table")
     ret = router.table_metadata("foo")
     assert ret is assignor.table_metadata.return_value
     assignor.table_metadata.assert_called_once_with(
         table.changelog_topic.get_topic_name(), )
Beispiel #8
0
 def assignor(self, *, app):
     assignor = app.assignor = Mock(name="assignor")
     return assignor