From b6eaa350481cfcc7ef460c2874a3e57afa6a8e9e Mon Sep 17 00:00:00 2001 From: "Olivier Wilkinson (reivilibre)" <oliverw@matrix.org> Date: Tue, 19 Nov 2024 10:27:15 +0000 Subject: [PATCH] Remove 40content.pl as it was moved to Complement Now at https://github.com/matrix-org/complement/blob/547e656efa8a94a1a36ba7566f44626316491df4/tests/csapi/apidoc_content_test.go#L13-L30 --- tests/10apidoc/40content.pl | 61 ------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 tests/10apidoc/40content.pl diff --git a/tests/10apidoc/40content.pl b/tests/10apidoc/40content.pl deleted file mode 100644 index 3f00385bd..000000000 --- a/tests/10apidoc/40content.pl +++ /dev/null @@ -1,61 +0,0 @@ -my $content = <<'EOF'; -Here is the content I am uploading -EOF - -my $content_type = "text/plain"; -my $content_id; - -test "POST /media/v3/upload can create an upload", - requires => [ $main::API_CLIENTS[0], local_user_fixture() ], - - proves => [qw( can_upload_media )], - - do => sub { - my ( $http, $user ) = @_; - - # Because we're POST'ing non-JSON - $http->do_request( - method => "POST", - full_uri => "/_matrix/media/v3/upload", - params => { - access_token => $user->access_token, - }, - - content_type => $content_type, - content => $content, - )->then( sub { - my ( $body ) = @_; - - assert_json_keys( $body, qw( content_uri )); - - my $content_uri = URI->new( $body->{content_uri} ); - $content_id = [ $content_uri->authority, $content_uri->path ]; - - Future->done(1); - }); - }; - -test "GET /media/v3/download can fetch the value again", - requires => [ $main::API_CLIENTS[0], - qw( can_upload_media )], - - proves => [qw( can_download_media )], - - check => sub { - my ( $http ) = @_; - - $http->do_request( - method => "GET", - full_uri => "/_matrix/media/v3/download/" . join( "", @$content_id ), - # No access_token; it should be public - )->then( sub { - my ( $got_content, $response ) = @_; - - $got_content eq $content or - die "Content not as expected"; - $response->content_type eq $content_type or - die "Content-Type not as expected"; - - Future->done(1); - }); - };