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/perl
use strict;
use warnings;
use FindBin;
use lib "$FindBin::RealBin/lib";
use Test::More;
use Test::Exception;
use Bio::Chado::Schema::Test;
my $schema = Bio::Chado::Schema::Test->init_schema();
isa_ok( $schema, 'DBIx::Class::Schema' );
my $organism = $schema->resultset('Organism::Organism');
isa_ok( $organism, 'DBIx::Class::ResultSet' );
lives_ok(
sub {
$organism
->get_column('organism_id')
->max()
},
'query into organism table lives'
);
my $org = $organism->create({
abbreviation => 'T. testii',
genus => 'Testus',
species => 'testii',
common_name => 'Test organism',
comment => 'This is a test organism',
});
like( $org->organism_id, qr/^\d+$/, 'inserted a new organism' );
is( $org->dbxrefs->count, 0, 'got no dbxrefs' );
is( $org->phylonodes->count, 0, 'got no phylonodes' );
$org->delete;
done_testing;
|