Bio::C...::Test(3pm)
π Bio::C...::Test(3pm) π
okay bestie, gather round, because this is the manual page for Bio::Chado::Schema::Test from the User Contributed Perl Documentation, and it is literally the little helper module that makes writing tests against Bio::Chado::Schema not a whole ordeal. she's the backstage crew of the test suite. no cap. β¨
πΈ NAME πΈ
Bio::Chado::Schema::Test β a library meant to be used by Bio::Chado::Schema test scripts. that's her whole job and she does it gorgeously. π
π SYNOPSIS π
use lib qw(t/lib);
use Bio::Chado::Schema::Test;
use Test::More;
my $schema = Bio::Chado::Schema::Test->init_schema();
look at that. four lines. she's serving simplicity. π¦
β¨ DESCRIPTION β¨
This module hands you the basic utilities you need to write tests against Bio::Chado::Schema. it's giving infrastructure but make it cute. you bring the assertions, she brings the schema. π«Ά
π METHODS π
π init_schema
my $schema = Bio::Chado::Schema::Test->init_schema(
deploy => 1,
populate => 1,
storage_type => '::DBI::Replicated',
storage_type_args => {
balancer_type=>'DBIx::Class::Storage::DBI::Replicated::Balancer::Random'
},
);
okay so here's the tea β β this method removes the test SQLite database sitting at t/var/BCS.db, and then creates a brand-new, empty database in its place. out with the old, in with the fresh. π₯
- by default this method will call
deploy_schema()β unless you set thedeployflag to0, in which case she minds her business and doesn't. - this method will call
populate_schema()only if thepopulateargument is set to a true value. no true value, no populating. simple as that. π
bestie, note the vibe: the default behavior is to deploy. if you don't want that, you gotta say so with deploy => 0. π
π§ has_custom_dsn
Returns true if the BCS_TEST_DSN environment variable is set. that's it. that's the method. short queen behavior. π
π deploy_schema
Bio::Chado::Schema::Test->deploy_schema( $schema );
This method does one of two things to the schema, and she picks based on the environment, which is very main character of her:
- If the
BCSTEST_SQLT_DEPLOYenvironment variable is set, she'll call the experimental$schema->deploy(). π - Otherwise, the default is to read in the
t/lib/sqlite.sqlfile and execute the SQL inside it.
either way you end up with a fresh set of tables for testing. same destination, two routes, both iconic. β¨
heads up: $schema->deploy() is flagged experimental in the original, so don't come for her if the experimental path does experimental things. π
πΈ populate_schema
Bio::Chado::Schema::Test->populate_schema( $schema );
after you deploy your schema, you can use this method to populate the tables with test data. deploy first, populate second β that's the order, bestie, don't fight it. π
π« SEE ALSO π«
there are no SEE ALSO references in this page, which is honestly so real of her. she's self-contained. she's enough. periodt. π
π«Ά SIGN-OFF π«Ά
this page is from the User Contributed Perl Documentation, generated for perl v5.32.0, dated 2020-12-04. thanks for coming to my TED talk, go write some tests, and remember: init_schema() first, everything else after. mwah. πβ¨ππ¦
π¦ where this page comes from
- debian bookworm: libbio-chado-schema-perl 0.20000-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libbio-chado-schema-perl 0.20000-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libbio-chado-schema-perl 0.20000-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libbio-chado-schema-perl 0.20000-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libbio-chado-schema-perl 0.20000-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libbio-chado-schema-perl 0.20000-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms