Last change
on this file since 31 was
31,
checked in by thauvin, 19 years ago
|
|
-
Property cvs2svn:cvs-rev set to
1.2
-
Property svn:keywords set to
Author Date Id Revision
-
Property svn:mime-type set to
text/x-troff
|
File size:
845 bytes
|
Line | |
---|
1 | |
---|
2 | # $Id$ |
---|
3 | |
---|
4 | use Test::More tests => 6; |
---|
5 | use File::Temp qw(tempdir); |
---|
6 | use ObsData::Repository; |
---|
7 | |
---|
8 | { |
---|
9 | my $td = tempdir; |
---|
10 | ok(ObsData::Repository::init_repository($td), "Can initialize repos data"); |
---|
11 | ok(-f "$td/obsdata.db", "db is really create"); |
---|
12 | ok(-d "$td/logs", "log directory exists"); |
---|
13 | |
---|
14 | ok(ObsData::Repository->new(configfile => 'testdata/obsdata-conftest', dir => $td), "Can create object"); |
---|
15 | |
---|
16 | my $odr = ObsData::Repository->new( |
---|
17 | configfile => 'testdata/obsdata-conftest', dir => $td, |
---|
18 | sublog => sub { |
---|
19 | ok($_[0] eq "INFO", "Log Callback give good loglevel"); |
---|
20 | ok($_[2] eq "LOG MSG", "Log Callback give good message"); |
---|
21 | }, |
---|
22 | ); |
---|
23 | |
---|
24 | $odr->logmsg('INFO', undef, "LOG %s", 'MSG'); |
---|
25 | # DEBUG msg are filtrered, so if more test are run, there is a pb here |
---|
26 | $odr->logmsg('DEBUG', undef, "LOG %s", 'MSG'); |
---|
27 | $odr = undef; |
---|
28 | |
---|
29 | system("rm -fr $td"); |
---|
30 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.