def test_web_yosai_get_current_webregistry(web_yosai, monkeypatch): mock_stack = ['webregistry'] monkeypatch.setattr(global_webregistry_context, 'stack', mock_stack) result = WebYosai.get_current_webregistry() assert result == 'webregistry'
def test_web_yosai_get_current_webregistry_raises(web_yosai, monkeypatch): mock_stack = [] monkeypatch.setattr(global_webregistry_context, 'stack', mock_stack) with pytest.raises(YosaiContextException): WebYosai.get_current_webregistry()