示例#1
0
 def test_modify_text(self):
     self.assertEqual(webapp.modify_text('test', webapp.green),
                      '\x1b[92mtest\x1b[0m')
示例#2
0
 def test_modify_text(self):
     self.assertEqual(
         webapp.modify_text('test', webapp.green),
         '\x1b[92mtest\x1b[0m'
     )
示例#3
0
try:
    from local_config import TEST_USER
except ImportError:
    print('''
    You have not specified a TEST_USER in local_config.py

    If you wish to auto-login as a certain user, set TEST_USER in
    local_config.py

    Otherwise run webapp.py as opposed to tests/python/webapp.py
    ''')
    sys.exit(1)


msg = '''
FOR TESTING PURPOSES ONLY!
FOR TESTING PURPOSES ONLY!
FOR TESTING PURPOSES ONLY!
--------------------------
Logging in as:
{}
--------------------------
FOR TESTING PURPOSES ONLY!
FOR TESTING PURPOSES ONLY!
FOR TESTING PURPOSES ONLY!
'''.format(TEST_USER, indent=4)
with patch.object(BaseHandler, '_current_user_cookie') as p:
    p.return_value = TEST_USER
    main(modify_text(msg, green))
示例#4
0
from webapp import main, modify_text, green

try:
    from local_config import TEST_USER
except ImportError:
    print('''
    You have not specified a TEST_USER in local_config.py

    If you wish to auto-login as a certain user, set TEST_USER in
    local_config.py

    Otherwise run webapp.py as opposed to tests/python/webapp.py
    ''')
    sys.exit(1)

msg = '''
FOR TESTING PURPOSES ONLY!
FOR TESTING PURPOSES ONLY!
FOR TESTING PURPOSES ONLY!
--------------------------
Logging in as:
{}
--------------------------
FOR TESTING PURPOSES ONLY!
FOR TESTING PURPOSES ONLY!
FOR TESTING PURPOSES ONLY!
'''.format(TEST_USER, indent=4)
with patch.object(BaseHandler, '_current_user_cookie') as p:
    p.return_value = TEST_USER
    main(modify_text(msg, green))