File: Provisioning.pm

package info (click to toggle)
libvuser-google-api-perl 1.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 348 kB
  • sloc: perl: 3,176; makefile: 4
file content (39 lines) | stat: -rw-r--r-- 700 bytes parent folder | download | duplicates (3)
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
package Test::VUser::Google::Provisioning;
use warnings;
use strict;

use Test::Most;
use base 'My::Test::Class';

my $acct;

sub constructor : Tests(3) {
    my $test = shift;
    my $class = $test->class;

    can_ok $class, 'new';
    ok my $api = $class->new(google => $test->create_google),
        '... and the constructor should succeed';
    isa_ok $api, $class, '... and the object it returns';
}

sub get_test_user {
    my $self = shift;

    if (1 || not defined $acct) {
	my @time = localtime;
	$acct = sprintf (
	    'test.%04d.%02d.%02d.%02d.%02d.%02d',
	    $time[5]+1900,
	    $time[4]+1,
	    $time[3],
	    $time[2],
	    $time[1],
	    $time[0]
	);
    }

    return $acct;
}

1;