~ubuntu-branches/ubuntu/maverick/lire/maverick

« back to all changes in this revision

Viewing changes to all/lib/tests/DlfCategoriserTest.pm

  • Committer: Bazaar Package Importer
  • Author(s): Joost van Baal
  • Date: 2006-11-02 15:30:00 UTC
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20061102153000-343pa15n0rp58m1b
Tags: upstream-2.0.2
ImportĀ upstreamĀ versionĀ 2.0.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
                                                                @_ ] },
59
59
                         'categorise' => sub { push @{$_[0]}, [ 'categorise',
60
60
                                                                @_ ] },
 
61
                         'finalise' => sub { push @{$_[0]}, [ 'finalise', @_]},
61
62
                        } );
62
63
    my $process = $self->create_mock_process( $categoriser );
63
64
 
77
78
 
78
79
    $process->run_analysis_job( $self->{'20040311_121201'} );
79
80
 
80
 
    $self->assert_num_equals( 4, scalar @$categoriser );
 
81
    $self->assert_num_equals( 5, scalar @$categoriser );
81
82
    $self->assert_str_equals( 'initialise', $categoriser->[0][0] );
82
83
    $self->assert_str_equals( 'categorise', $categoriser->[1][0] );
83
84
    $self->assert_num_equals( $self->{'20040311_121201'} -3600,
86
87
                              $categoriser->[2][2]{'time_start'} );
87
88
    $self->assert_num_equals( $self->{'20040311_121201'} +3600,
88
89
                              $categoriser->[3][2]{'time_start'} );
 
90
    $self->assert_str_equals( 'finalise', $categoriser->[4][0] );
89
91
 
90
92
    $self->assert_null( $process->{'errors'} );
91
93
    $self->assert_num_equals( 3, scalar @{$process->{'dlf'}} );
174
176
    Lire::PluginManager->register_plugin( $categoriser );
175
177
    return
176
178
      new Class::Inner( 'parent' => 'Lire::DlfAnalyserProcess',
177
 
                        'args' => [ $self->{'store'}, $categoriser->name(), 
 
179
                        'args' => [ $self->{'store'}, $categoriser->name(),
178
180
                                    $self->{'config'}, 'my_source' ],
179
181
                        'methods' =>
180
182
                        {