Skip to content

Commit 134aadb

Browse files
author
api.jscudder
committed
Changed variable names for the username, password, and domain for the run all tests script. Part of a fix for issue 55.
1 parent 5138195 commit 134aadb

1 file changed

Lines changed: 21 additions & 19 deletions

File tree

tests/gdata_tests/apps/service_test.py

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,19 @@
2727
import getpass
2828
import time
2929

30-
domain = ''
31-
username = ''
32-
password = ''
30+
31+
apps_domain = ''
32+
apps_username = ''
33+
apps_password = ''
34+
3335

3436
class AppsServiceUnitTest01(unittest.TestCase):
3537

3638
def setUp(self):
3739
self.postfix = time.strftime("%Y%m%d%H%M%S")
38-
email = username + '@' + domain
40+
email = apps_username + '@' + apps_domain
3941
self.apps_client = gdata.apps.service.AppsService(
40-
email=email, domain=domain, password=password,
42+
email=email, domain=apps_domain, password=apps_password,
4143
source='AppsClient "Unit" Tests')
4244
self.apps_client.ProgrammaticLogin()
4345
self.created_user = None
@@ -53,13 +55,13 @@ def test001RetrieveUser(self):
5355
"""Tests RetrieveUser method"""
5456

5557
try:
56-
self_user_entry = self.apps_client.RetrieveUser(username)
58+
self_user_entry = self.apps_client.RetrieveUser(apps_username)
5759
except:
5860
self.fail('Unexpected exception occurred')
5961
self.assert_(isinstance(self_user_entry, gdata.apps.UserEntry),
6062
"The return value of RetrieveUser() must be an instance of " +
6163
"apps.UserEntry: %s" % self_user_entry)
62-
self.assertEquals(self_user_entry.login.user_name, username)
64+
self.assertEquals(self_user_entry.login.user_name, apps_username)
6365

6466
def test002RetrieveUserRaisesException(self):
6567
"""Tests if RetrieveUser() raises AppsForYourDomainException with
@@ -287,9 +289,9 @@ class AppsServiceUnitTest02(unittest.TestCase):
287289

288290
def setUp(self):
289291
self.postfix = time.strftime("%Y%m%d%H%M%S")
290-
email = username + '@' + domain
292+
email = apps_username + '@' + apps_domain
291293
self.apps_client = gdata.apps.service.AppsService(
292-
email=email, domain=domain, password=password,
294+
email=email, domain=apps_domain, password=apps_password,
293295
source='AppsClient "Unit" Tests')
294296
self.apps_client.ProgrammaticLogin()
295297
self.created_users = []
@@ -356,7 +358,7 @@ def test001MethodsForEmaillist(self):
356358
# tests AddRecipientToEmailList method
357359
try:
358360
recipient = self.apps_client.AddRecipientToEmailList(
359-
user_yuji.login.user_name + '@' + domain,
361+
user_yuji.login.user_name + '@' + apps_domain,
360362
list_name)
361363
except Exception, e:
362364
self.fail('Unexpected exception occurred: %s' % e)
@@ -365,11 +367,11 @@ def test001MethodsForEmaillist(self):
365367
"Return value of AddRecipientToEmailList method must be an instance " +
366368
"of EmailListRecipientEntry: %s" % recipient)
367369
self.assertEquals(recipient.who.email,
368-
user_yuji.login.user_name + '@' + domain)
370+
user_yuji.login.user_name + '@' + apps_domain)
369371

370372
try:
371373
recipient = self.apps_client.AddRecipientToEmailList(
372-
user_taro.login.user_name + '@' + domain,
374+
user_taro.login.user_name + '@' + apps_domain,
373375
list_name)
374376
except Exception, e:
375377
self.fail('Unexpected exception occurred: %s' % e)
@@ -388,7 +390,7 @@ def test001MethodsForEmaillist(self):
388390
# tests RemoveRecipientFromEmailList method
389391
try:
390392
self.apps_client.RemoveRecipientFromEmailList(
391-
user_taro.login.user_name + '@' + domain, list_name)
393+
user_taro.login.user_name + '@' + apps_domain, list_name)
392394
except Exception, e:
393395
self.fail('Unexpected exception occurred: %s' % e)
394396

@@ -420,7 +422,7 @@ def test001MethodsForEmaillist(self):
420422
# tests RetrieveEmailLists method.
421423
try:
422424
list_feed = self.apps_client.RetrieveEmailLists(
423-
user_yuji.login.user_name + '@' + domain)
425+
user_yuji.login.user_name + '@' + apps_domain)
424426
except Exception, e:
425427
self.fail('Unexpected exception occurred: %s' % e)
426428
self.assert_(isinstance(list_feed, gdata.apps.EmailListFeed),
@@ -453,9 +455,9 @@ class AppsServiceUnitTest03(unittest.TestCase):
453455

454456
def setUp(self):
455457
self.postfix = time.strftime("%Y%m%d%H%M%S")
456-
email = username + '@' + domain
458+
email = apps_username + '@' + apps_domain
457459
self.apps_client = gdata.apps.service.AppsService(
458-
email=email, domain=domain, password=password,
460+
email=email, domain=apps_domain, password=apps_password,
459461
source='AppsClient "Unit" Tests')
460462
self.apps_client.ProgrammaticLogin()
461463
self.created_users = []
@@ -494,7 +496,7 @@ def test001Pagenation(self):
494496
if __name__ == '__main__':
495497
print ('NOTE: Please run these tests only with a test domain. ' +
496498
'The tests may delete or update your domain\'s account data.')
497-
domain = raw_input('Please enter your domain: ')
498-
username = raw_input('Please enter your username of admin account: ')
499-
password = getpass.getpass()
499+
apps_domain = raw_input('Please enter your domain: ')
500+
apps_username = raw_input('Please enter your username of admin account: ')
501+
apps_password = getpass.getpass()
500502
unittest.main()

0 commit comments

Comments
 (0)