mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-15 02:11:15 +08:00
commit
868b49463f
@ -229,8 +229,15 @@ class TestInterface(unittest.TestCase):
|
||||
interface.integrate(mlflow=mlflow)
|
||||
mock_post.assert_called_once()
|
||||
|
||||
|
||||
|
||||
|
||||
def test_capture_session(self):
|
||||
interface = Interface(lambda x: x, "textbox", "label", capture_session=True, interpretation=lambda x: 0)
|
||||
interface.session = (mock.MagicMock(), mock.MagicMock())
|
||||
interface.interpret(["quickest brown fox"])
|
||||
interface.session[0].as_default.assert_called_once()
|
||||
interface.session[1].as_default.assert_called_once()
|
||||
interface.run_prediction(["quickest brown fox"])
|
||||
self.assertEqual(interface.session[0].as_default.call_count, 2)
|
||||
self.assertEqual(interface.session[1].as_default.call_count, 2)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
Loading…
Reference in New Issue
Block a user