File: 500-org.t

package info (click to toggle)
libnet-github-perl 1.05-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 376 kB
  • sloc: perl: 2,073; makefile: 8
file content (43 lines) | stat: -rw-r--r-- 975 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env perl

use strict;
use warnings;
use Test::More;
use Net::GitHub::V3;

plan skip_all => 'Please export environment variable GITHUB_USER/GITHUB_PASS'
     unless $ENV{GITHUB_USER} and $ENV{GITHUB_PASS};

my $gh = Net::GitHub::V3->new( login => $ENV{GITHUB_USER}, pass => $ENV{GITHUB_PASS});
my $org = $gh->org;

diag( 'Using user = ' . $ENV{GITHUB_USER} );

ok( $gh );
ok( $org );

=pod

my $o = $org->org('perlchina'); # PerlChina
ok($o);
is($o->{'billing_email'}, 'perlchina@googlegroups.com');

$o = $org->update_org('perlchina', { name => 'PerlChina' });
ok($o);
is($o->{name}, 'PerlChina');

=cut

SKIP: {
	skip 'Resource not accessible by integration', 3 if $ENV{AUTOMATED_TESTING};

	my $is_member = $org->is_member('perlchina', 'fayland');
	is($is_member, 1);
	$is_member = $org->is_member('perlchina', 'nothingmuch');
	is($is_member, 0);

	my $membership = $org->membership('perlchina', 'fayland');
	is($membership->{state}, 'active');
}

done_testing;