anchor.diff:          end
       ),
       init_per_testcase(default, Config);
  -    
  -init_per_testcase(Case, Config) when 
  +
  +init_per_testcase(Case, Config) when
       Case =:= quota_updated_on_gui_upload;
       Case =:= failed_gui_upload_test ->
       Workers = ?config(op_worker_nodes, Config),
       ok = test_utils:mock_new(Workers, cow_multipart),
       ok = test_utils:mock_new(Workers, cowboy_req),
  -    ok = test_utils:mock_expect(Workers, cow_multipart, form_data, 
  +    ok = test_utils:mock_expect(Workers, cow_multipart, form_data,
           fun(_) -> {file, ok, ok, ok} end),
  -    ok = test_utils:mock_expect(Workers, cowboy_req, read_part_body, 
  -        fun F(#{left := 1}=Req, Opts) -> 
  +    ok = test_utils:mock_expect(Workers, cowboy_req, read_part_body,
  +        fun F(#{left := 1}=Req, Opts) ->
                   F(maps:remove(left, Req), Opts);
  -            F(#{left := Left, size := Size} = Req, _Opts) -> 
  +            F(#{left := Left, size := Size} = Req, _Opts) ->
                   {more, crypto:strong_rand_bytes(Size), Req#{left => Left-1}};
  -            F(#{size := Size}=Req, _Opts) -> 
  +            F(#{size := Size}=Req, _Opts) ->
                   {ok, crypto:strong_rand_bytes(Size), Req#{done => true}}
           end),
  -    ok = test_utils:mock_expect(Workers, cowboy_req, read_part, 
  +    ok = test_utils:mock_expect(Workers, cowboy_req, read_part,
           fun (#{done := true} = Req) -> {done, Req}; (Req) -> {ok, [], Req} end),
       init_per_testcase(default, Config);
   
  
positive.code:         gen_test_env(Config),
  
      {ok, #file_attr{guid = Guid}} = lfm_proxy:stat(P1, User1, {path, <<"/space4">>}),
      
      FileSize = 500*1024*1024, % 500 MB
  
      ProviderId = initializer:domain_to_provider_id(?GET_DOMAIN(P1)),
      % Upload File1 500MB to space4
      do_multipart(P1, User1, 100, 1048576, 5, Guid, File1),
      
      {ok, FileHandle} = lfm_proxy:open(P1, User1, f(<<"space4">>, File1), rdwr),
      ok = lfm_proxy:fsync(P1, FileHandle),
      ?assertMatch(FileSize, current_size(P1, <<"space_id4">>)),
      
      % Upload File2 800MB to space4
      do_multipart(P1, User1, 160, 1048576, 5, Guid, File2),
      ok = lfm_proxy:fsync(P1, User1, f(<<"space4">>, File2), ProviderId),
  
negative.code: 
      SpaceSize = available_size(SupportingProvider, SpaceId),
      RootGuid = fslogic_uuid:spaceid_to_space_dir_guid(SpaceId),
  
      {ok, {Conn, _}} = fuse_test_utils:connect_via_macaroon(P1, [{active, true}], SessId(P1)),
      SubId = rpc:call(P1, subscription,  generate_id, [<<"quota_exceeded">>]),
      rpc:call(P1, event, subscribe, [#subscription{id = SubId, type = #quota_exceeded_subscription{}}, SessId(P1)]),
  