Re: Module name advice

2005-10-19 Thread José Castro
* David Golden ([EMAIL PROTECTED]) wrote:
 Mattia Barbon [EMAIL PROTECTED] wrote:
   Having discarded a top-level namespace, I am now
 inclined to use WWW::Selenium for the Selenium driver
 and Test::Selenium for the TAP-emitting module
 to be used in test scripts. 
 
   Does anybody have suggestions?
 
 For consistency with WWW::Mechanize and Test::WWW::Mechanize (and other 
 Test::WWW tools), I'd suggest going with WWW::Selenium and 
 Test::WWW::Selenium.

I second that (I was actually going to say the same thing).

Cheers,

jac

--
Jose Alves de Castro [EMAIL PROTECTED]
  http://jose-castro.org/


Tests needing user parameters

2005-10-19 Thread Jess Robinson

Hey folks,

I'm writing a module which will need user account data for it's tests, and 
I'm wondering if theres a standard way (or module) for doing this.. 

Else I'll guess I'll look for environment variables and otherwise not 
test, any ideas?

Jess



Re: Tests needing user parameters

2005-10-19 Thread Tim Maher
On Wed, Oct 19, 2005 at 09:51:12PM +0100, Jess Robinson wrote:
 
 Hey folks,
 
 I'm writing a module which will need user account data for it's tests, and 
 I'm wondering if there's a standard way (or module) for doing this.. 

What do you mean by user account data? 

Perhaps UNIX/Linux UIDs and GIDs?

Or insurance-company customer policy-numbers?

Give us a clue, dude!
 
 Else I'll guess I'll look for environment variables and otherwise not 
 test, any ideas?
 
 Jess

The otherwise not test part of that sentence makes me hope your code
won't be managing a nucular* reactor! 8-}

-Tim
*Spelled in accordance with the Homerian/Dubya-ish pronunciation.
*--*
| Tim Maher, PhD (206) 781-UNIX  (866) DOC-PERL (866) DOC-UNIX |
| tim(AT)Consultix-Inc.Com  http://TeachMePerl.Com  http://TeachMeUnix.Com |
| CLASSES: Perl and CGI Programming, 11/14-18UNIX Fundamentals: 12/6-9 |
*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*
| Watch for my upcoming book: Minimal Perl for UNIX/Linux People |
|  See http://minimalperl.com for details, ordering, and email-list signup |
*--*


Re: Tests needing user parameters

2005-10-19 Thread Mark Stosberg
On Wed, Oct 19, 2005 at 10:50:04PM +0100, Jess Robinson wrote:
   
   I'm writing a module which will need user account data for it's tests, 
   and 
   I'm wondering if there's a standard way (or module) for doing this.. 
  
  What do you mean by user account data? 
  
  Perhaps UNIX/Linux UIDs and GIDs?
 
 Oops, sorry, thought it made sense ;)
 
 My module will login to a web service and manipulate data 
 programmatically.. Nothing critical I assure you, just a tool ;) Since 
 theres no dummy/test account that I know of, I'll need the users 
 account/email address and password to login.

Using an OO approach is one way to go:

my $t = Test::Foo-new(\%my_params);

$t-wobble_ok('zoop');

Mark


Re: Tests needing user parameters

2005-10-19 Thread psema4
On 10/19/05, Mark Stosberg [EMAIL PROTECTED] wrote:
 On Wed, Oct 19, 2005 at 10:50:04PM +0100, Jess Robinson wrote:
   
I'm writing a module which will need user account data for it's tests, 
and
I'm wondering if there's a standard way (or module) for doing this..
  
   What do you mean by user account data?
  
   Perhaps UNIX/Linux UIDs and GIDs?
 
  Oops, sorry, thought it made sense ;)
 
  My module will login to a web service and manipulate data
  programmatically.. Nothing critical I assure you, just a tool ;) Since
  theres no dummy/test account that I know of, I'll need the users
  account/email address and password to login.

 Using an OO approach is one way to go:

 my $t = Test::Foo-new(\%my_params);

 $t-wobble_ok('zoop');

If you have administrative access (or mod_auth_mysql installed, along
with a mysql database), this method might work.  Similar solutions
might also be workable, depending on your setup and installed
packages.

I've been using mod_auth_mysql, Apache, and CGI.pm to handle this
situation (if I'm reading the question right) for a couple years now. 
A scheduled cron job runs every 30 minutes to copy the email users
encrypted passwords into the mysql tables if they've changed, adding
or removing user records as necessary to keep in sync with the email
accounts.  (Might be a hack but it works.)

After that, it's a relatively simple matter of setting up .htaccess
files (or http.conf) and adding to your scripts:

...
use CGI;
my $q = new CGI;
my $remote_user = $q-remote_user();
...

--
- SGE


Re[2]: Module name advice

2005-10-19 Thread Mattia Barbon
On Wed, 19 Oct 2005 09:34:51 +0100 José Castro [EMAIL PROTECTED] wrote:

 * David Golden ([EMAIL PROTECTED]) wrote:
  Mattia Barbon [EMAIL PROTECTED] wrote:
Having discarded a top-level namespace, I am now
  inclined to use WWW::Selenium for the Selenium driver
  and Test::Selenium for the TAP-emitting module
  to be used in test scripts. 
  
Does anybody have suggestions?
  
  For consistency with WWW::Mechanize and Test::WWW::Mechanize (and other 
  Test::WWW tools), I'd suggest going with WWW::Selenium and 
  Test::WWW::Selenium.
 
 I second that (I was actually going to say the same thing).

  I agree. Thank you both!

Regards
Mattia



Re: Tests needing user parameters

2005-10-19 Thread psema4
On 10/19/05, psema4 [EMAIL PROTECTED] wrote:
   My module will login to a web service and manipulate data
   programmatically.. Nothing critical I assure you, just a tool ;) Since
   theres no dummy/test account that I know of, I'll need the users
   account/email address and password to login.

n/m.  Sorry.  Think I misread the problem.   I'm really going to need
to Test::sleep soon.  :-)

--
- SGE


Re: Tests needing user parameters

2005-10-19 Thread Ken Williams


On Oct 19, 2005, at 4:50 PM, Jess Robinson wrote:


My module will login to a web service and manipulate data
programmatically.. Nothing critical I assure you, just a tool ;) Since
theres no dummy/test account that I know of, I'll need the users
account/email address and password to login.


Typically you'd add some code to the Makefile.PL or Build.PL that asks 
the user for a username/password to use for testing, and gives the user 
an option to skip those tests.  DBI modules often do this, for example 
(where the username/password is for a database to access).


If you're using ExtUtils::MakeMaker, you'll have to find some file to 
stash the information, probably somewhere in t/ .  If you're using 
Module::Build, have a look at the notes() method, which is for caching 
this kind of information.


 -Ken