Пример #1
0
    def test_delete_session_when_dead_throws(self):
        http_client = MagicMock()
        http_client.post.return_value = DummyResponse(201, self.session_create_json)
        session = LivySession(http_client, "scala", state_sleep_seconds=0.01, statement_sleep_seconds=0.01)
        session._state = "dead"

        session.delete()
Пример #2
0
    def test_delete_session_when_not_started(self):
        http_client = MagicMock()
        http_client.post.return_value = DummyResponse(201, self.session_create_json)
        session = LivySession(http_client, "scala", state_sleep_seconds=0.01, statement_sleep_seconds=0.01)

        session.delete()
    
        assert_equals("dead", session._state)
Пример #3
0
    def test_delete_session_when_dead_throws(self):
        http_client = MagicMock()
        http_client.post.return_value = DummyResponse(201, self.session_create_json)
        _t_config_hook({
            "status_sleep_seconds": 0.01,
            "statement_sleep_seconds": 0.01
        })
        session = LivySession(http_client, "scala", "-1", False)
        _t_config_hook({})
        session._status = "dead"

        session.delete()