コード例 #1
0
ファイル: test_base.py プロジェクト: wuttem/faust
 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
コード例 #2
0
ファイル: test_base.py プロジェクト: wuttem/faust
 def test_contribute_to_stream(self, *, table):
     table.contribute_to_stream(Mock(name='stream', autospec=Stream))
コード例 #3
0
ファイル: test_base.py プロジェクト: wuttem/faust
 async def test_remove_from_stream(self, *, table):
     await table.remove_from_stream(Mock(name='stream', autospec=Stream))
コード例 #4
0
ファイル: test_base.py プロジェクト: wuttem/faust
 def test_combine(self, *, table):
     with pytest.raises(NotImplementedError):
         table.combine(Mock(name='joinable', autospec=Stream))
コード例 #5
0
ファイル: test_base.py プロジェクト: wuttem/faust
 def test__join(self, *, table):
     with pytest.raises(NotImplementedError):
         table._join(Mock(name='join_strategy', autospec=joins.Join))
コード例 #6
0
ファイル: test_base.py プロジェクト: wuttem/faust
 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()
コード例 #7
0
ファイル: test_router.py プロジェクト: wayfair-contribs/faust
 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(), )
コード例 #8
0
ファイル: test_router.py プロジェクト: wayfair-contribs/faust
 def assignor(self, *, app):
     assignor = app.assignor = Mock(name="assignor")
     return assignor