Skip to content

Commit

Permalink
Merge pull request #330 from matrix-org/rav/no_get_e2e_keys
Browse files Browse the repository at this point in the history
Make E2E key tests use specced endpoints
  • Loading branch information
richvdh committed Dec 12, 2016
2 parents d8a4589 + 79f65e4 commit 57bdf61
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 29 deletions.
31 changes: 3 additions & 28 deletions tests/41end-to-end-keys/01-upload-key.pl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

do_request_json_for( $user,
method => "POST",
uri => "/unstable/keys/query/",
uri => "/unstable/keys/query",
content => {
device_keys => {
$user->user_id => {}
Expand Down Expand Up @@ -89,7 +89,7 @@

do_request_json_for( $user,
method => "POST",
uri => "/unstable/keys/query/",
uri => "/unstable/keys/query",
content => {
device_keys => {
$user->user_id => [ $device_id ]
Expand All @@ -110,31 +110,6 @@
})
};

test "Can query device keys using GET",
requires => [ $fixture,
qw( can_upload_e2e_keys )],

check => sub {
my ( $user ) = @_;

do_request_json_for( $user,
method => "GET",
uri => "/unstable/keys/query/${\$user->user_id}"
)->then( sub {
my ( $content ) = @_;

assert_json_keys( $content, "device_keys" );

my $device_keys = $content->{device_keys};
assert_json_keys( $device_keys, $user->user_id );

my $alice_keys = $device_keys->{ $user->user_id };
assert_json_keys( $alice_keys, $user->device_id );
# TODO: Check that the content matches what we uploaded.
Future->done(1)
})
};

test "query for user with no keys returns empty key dict",
requires => [ local_user_fixture() ],

Expand All @@ -143,7 +118,7 @@

do_request_json_for( $user,
method => "POST",
uri => "/unstable/keys/query/",
uri => "/unstable/keys/query",
content => {
device_keys => {
$user->user_id => {}
Expand Down
2 changes: 1 addition & 1 deletion tests/41end-to-end-keys/04-query-key-federation.pl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
})->then( sub {
do_request_json_for( $remote_user,
method => "POST",
uri => "/unstable/keys/query/",
uri => "/unstable/keys/query",
content => {
device_keys => {
$user->user_id => {}
Expand Down

0 comments on commit 57bdf61

Please sign in to comment.