File: GnomePasswordDialog.t

package info (click to toggle)
libgnome2-perl 1.045-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 608 kB
  • ctags: 12
  • sloc: perl: 1,145; ansic: 16; makefile: 4
file content (64 lines) | stat: -rw-r--r-- 1,569 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/perl -w
use strict;
use Gnome2;

use constant TESTS => 7;
use Test::More tests => TESTS;

# $Id$

###############################################################################

SKIP: {
  do "t/TestBoilerplate";

  skip("GnomePasswordDialog and GnomeAuthenticationManager didn't appear until 2.4.0", TESTS)
    unless (Gnome2 -> CHECK_VERSION(2, 4, 0));

  Gnome2::AuthenticationManager -> init();

  SKIP: {
    skip("dialog_is_visible is new in 2.8", 1)
      unless (Gnome2 -> CHECK_VERSION(2, 8, 0));

    ok(!Gnome2::AuthenticationManager -> dialog_is_visible());
  }

  my $dialog = Gnome2::PasswordDialog -> new("Bla", "Bla!", "bla", "alb", 1);
  isa_ok($dialog, "Gnome2::PasswordDialog");

  $dialog -> set_username("urgs");
  is($dialog -> get_username(), "urgs");

  $dialog -> set_password("urgs");
  is($dialog -> get_password(), "urgs");

  $dialog -> set_readonly_username(1);

  SKIP: {
    skip("things new in 2.6.0", 2)
      unless (Gnome2 -> CHECK_VERSION(2, 6, 0));

    $dialog -> set_show_username(1);
    $dialog -> set_show_domain(1);
    $dialog -> set_show_password(1);
    $dialog -> set_show_remember(1);
    $dialog -> set_readonly_domain(1);

    $dialog -> set_remember("nothing");
    is($dialog -> get_remember(), "nothing");

    $dialog -> set_domain("urgs");
    is($dialog -> get_domain(), "urgs");
  }

  SKIP: {
    skip("things new in 2.8.0", 1)
      unless (Gnome2 -> CHECK_VERSION(2, 8, 0));

    $dialog -> set_show_userpass_buttons(1);
    ok(!$dialog -> anon_selected());
  }

  # $dialog -> run_and_block();
}