File: synonym.t

package info (click to toggle)
libbio-chado-schema-perl 0.10010-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,800 kB
  • sloc: perl: 15,043; makefile: 7; sql: 3
file content (36 lines) | stat: -rw-r--r-- 905 bytes parent folder | download | duplicates (4)
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
#!/usr/bin/perl
use strict;
use warnings;

use FindBin;
use lib "$FindBin::RealBin/../lib";

use Test::More tests => 2;
use Test::Exception;
use Bio::Chado::Schema::Test;

my $schema = Bio::Chado::Schema::Test->init_schema();

my $syn_table = $schema->resultset('Sequence::Synonym');
isa_ok( $syn_table, 'DBIx::Class::ResultSet' );

$schema->txn_do(sub{
    # insert a feature with some sequence
    my $cvterm = $schema->resultset('Cv::Cvterm')
                 ->create_with({
                     name => 'tester',
                     cv   => 'testing cv',
                     db   => 'fake db',
                     dbxref => 'fake accession',
                 });
    my $synonym = $syn_table->create({
        name => 'foo',
        type => $cvterm,
        synonym_sgml => 'foo',
    });

    is( scalar( $synonym->features ), 0, 'feature mm works, returns 0' );

    $schema->txn_rollback;

});