code: def test_status_codes():
      with ExitStack() as stack:
          stack.enter_context(
              mock.patch(
                  "dtale.auth.global_state.get_auth_settings",
                  return_value={
                      "active": True,
                      "username": "foo",
                      "password": "bar",
                  },
              )
          )
          with build_app(url=URL).test_client() as c:
              resp = c.get("/login")
              assert resp.status_code == 200
              resp = c.get("/logout")
              assert resp.status_code == 302
  
      with ExitStack() as stack:
          stack.enter_context(
              mock.patch(
                  "dtale.auth.global_state.get_auth_settings",
                  return_value={"active": False},
              )
          )
          with build_app(url=URL).test_client() as c:
              resp = c.get("/login")
              assert resp.status_code == 404
              resp = c.get("/logout")
              assert resp.status_code == 404
  
file_path: dtale/tests/dtale/test_auth.py
imports: import mock
  import pandas
  import pytest
  from dtale.app import build_app
  from tests import ExitStack
  from tests.dtale.test_views import URL
  from tests.dtale import build_data_inst
label_desc: Use image node_id 1 for calling a global function with example usage: test_status_codes() without return types