Skip to content

Commit

Permalink
Fixes for Python 3 (#480)
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkowl committed Aug 9, 2018
1 parent 5e9b4a4 commit 62445bd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 37 deletions.
10 changes: 10 additions & 0 deletions tests/11register.pl
@@ -1,3 +1,4 @@
use utf8;
use JSON qw( decode_json );
use URI;

Expand Down Expand Up @@ -381,3 +382,12 @@
});
};

test "User signups are forbidden from starting with '_'",
requires => [ $main::API_CLIENTS[0] ],

do => sub {
my ( $http ) = @_;

matrix_register_user( $http, "_badname_here" )
->main::expect_http_4xx;
};
22 changes: 11 additions & 11 deletions tests/60app-services/01as-create.pl
Expand Up @@ -26,7 +26,7 @@
});
};

test "AS can create a user with inhibit_login",
test "AS can create a user with an underscore",
requires => [ $main::AS_USER[0], $room_fixture ],

do => sub {
Expand All @@ -37,43 +37,43 @@
uri => "/r0/register",

content => {
user => "astest-01create-1-$TEST_RUN_ID",
inhibit_login => 1,
user => "_astest-01create-0-$TEST_RUN_ID",
},
)->then( sub {
my ( $body ) = @_;

log_if_fail "Body", $body;

assert_json_keys( $body, qw( user_id home_server ));
foreach ( qw( device_id access_token )) {
exists $body->{$_} and die "Got an unexpected a '$_' key";
}
assert_json_keys( $body, qw( user_id home_server access_token device_id ));

Future->done(1);
});
};

test "AS can create a user via the legacy /v1 endpoint",

test "AS can create a user with inhibit_login",
requires => [ $main::AS_USER[0], $room_fixture ],

do => sub {
my ( $as_user, $room_id ) = @_;

do_request_json_for( $as_user,
method => "POST",
uri => "/api/v1/register",
uri => "/r0/register",

content => {
type => "m.login.application_service",
user => "astest-01create-2-$TEST_RUN_ID",
user => "astest-01create-1-$TEST_RUN_ID",
inhibit_login => 1,
},
)->then( sub {
my ( $body ) = @_;

log_if_fail "Body", $body;

assert_json_keys( $body, qw( user_id home_server ));
foreach ( qw( device_id access_token )) {
exists $body->{$_} and die "Got an unexpected a '$_' key";
}

Future->done(1);
});
Expand Down
26 changes: 0 additions & 26 deletions tests/90jira/SYN-738.pl

This file was deleted.

0 comments on commit 62445bd

Please sign in to comment.