« me slow, wife fast | Main | Gotham Invasion! »

funny test failure

so I was writing some tests for a module at work that interfaces with another company's product and pulls down reporting data. Sorry, i will not be naming names. :) One of the tests i always like to write is a test to make sure that a call will fail properly as well as succeed. So I proceed to write the following test.

    my $api = MODULE->new({ username => 'invalid', password => 'invalid' });
    ok( !$api->login(), "invalid login should fail." );

To my anger, my login failure test kept failing! I looked at the code a couple of times for errors before it occurred to me that invalid/invalid could actually be someone's account. Sure enough, a manual trip to the site in question confirmed that invalid/invalid was a real login. That is insanity! Add some rules to enforce at least some type of decent password.