File: 32-was_locked.t

package info (click to toggle)
libmediawiki-bot-perl 5.006003-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, stretch
  • size: 600 kB
  • ctags: 77
  • sloc: perl: 1,928; makefile: 5
file content (20 lines) | stat: -rw-r--r-- 502 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use strict;
use warnings;
use Test::RequiresInternet 'meta.wikimedia.org' => 80;
use Test::More tests => 2;

use MediaWiki::Bot;
my $t = __FILE__;

my $bot = MediaWiki::Bot->new({
    agent   => "MediaWiki::Bot tests (https://metacpan.org/MediaWiki::Bot; $t)",
    host    => 'meta.wikimedia.org',
});

# Hasn't been locked (yet)
my $result = $bot->was_locked('Jimbo Wales');
ok(!$result, 'lock history');

# I was once locked
$result = $bot->was_locked('Mike.lifeguard');
ok($result, 'lock history');