def METHOD_NAME(monkeypatch,
                                                                  requests_mock: requests_mock.Mocker,
                                                                  mock_ramdisk: MockRamdisk,
                                                                  cookie_file: str):
    # setup
    mock_bat_value_store = Mock()
    monkeypatch.setattr(bat, "get_bat_value_store", Mock(return_value=mock_bat_value_store))
    requests_mock.post(API_URL + "/login/Basic", cookies={"AuthCookie": "auth-cookie", "UserRecord": "user-record"})
    requests_mock.get(API_URL + "/meters/aggregates", status_code=401, additional_matcher=match_cookie_reject)
    requests_mock.get(API_URL + "/system_status/soe", status_code=401, additional_matcher=match_cookie_reject)
    requests_mock.get(API_URL + "/meters/aggregates", text=sample_aggregates_json, additional_matcher=match_cookie_ok)
    requests_mock.get(API_URL + "/system_status/soe", text=sample_soe_json, additional_matcher=match_cookie_ok)
    if cookie_file is not None:
        mock_ramdisk[COOKIE_FILE_NAME] = cookie_file
    # execution
    setup_battery_component().update()
    # evaluation
    assert json.loads(mock_ramdisk[COOKIE_FILE_NAME]) == {"AuthCookie": "auth-cookie", "UserRecord": "user-record"}
    assert_battery_state_correct(mock_bat_value_store.set.call_args[0][0])