コード例 #1
0
def main():

    # Setup test environment
    testlib.setup_test_environment()
    testlib.setup_test_db()

    try:
        # mock out interface calls
        interface.register_user = mock_register_user
        interface.get_logged_in_user = mock_get_logged_in_user

        # run tests
        test_post_blank_form()
        test_short_username()
        test_long_username()
        test_invalid_username()
        test_short_password()
        test_nonmatching_password()
        test_matching_username_password()
        test_short_affil()
        test_long_affil()
        test_invalid_email()
        test_key_upload_with_no_file()
        test_key_upload_with_oversized_file()
        test_key_upload_with_bad_format_key()
        test_key_upload_with_valid_key()
        test_normal()

        print "All tests passed."

    finally:
        testlib.teardown_test_db()
        testlib.teardown_test_environment()
コード例 #2
0
def main():
  
  # Setup test environment
  testlib.setup_test_environment()
  testlib.setup_test_db()
  
  try:
    # mock out interface calls
    interface.register_user = mock_register_user
    interface.get_logged_in_user = mock_get_logged_in_user
    
    # run tests
    test_post_blank_form()
    test_short_username()
    test_long_username()
    test_invalid_username()
    test_short_password()
    test_nonmatching_password()
    test_matching_username_password()
    test_short_affil()
    test_long_affil()
    test_invalid_email()
    test_key_upload_with_no_file()
    test_key_upload_with_oversized_file()
    test_key_upload_with_bad_format_key()
    test_key_upload_with_valid_key()
    test_normal()
    
    print "All tests passed."
    
  finally:
    testlib.teardown_test_db()
    testlib.teardown_test_environment()
コード例 #3
0
ファイル: ut_xmlrpc_frontend.py プロジェクト: Ashmita89/attic
def main():
  # The tests don't use the database, so we just make a single database
  # so that it exists to prevent unrelated errors when we use the models.
  testlib.setup_test_environment()
  testlib.setup_test_db()
  
  try:
    unittest.main()
  
  finally:
    testlib.teardown_test_db()
    testlib.teardown_test_environment()
コード例 #4
0
def main():
    # The tests don't use the database, so we just make a single database
    # so that it exists to prevent unrelated errors when we use the models.
    testlib.setup_test_environment()
    testlib.setup_test_db()

    try:
        unittest.main()

    finally:
        testlib.teardown_test_db()
        testlib.teardown_test_environment()
コード例 #5
0
def main():

    # Setup test environment
    testlib.setup_test_environment()
    testlib.setup_test_db()

    try:
        login_test_user()
        test_regenerate_api_key()
        print "All tests passed."

    finally:
        testlib.teardown_test_db()
        testlib.teardown_test_environment()
コード例 #6
0
def main():
  
  # Setup test environment
  testlib.setup_test_environment()
  testlib.setup_test_db()
  
  try:
    login_test_user()
    test_regenerate_api_key()
    print "All tests passed."
    
  finally:
    testlib.teardown_test_db()
    testlib.teardown_test_environment()
コード例 #7
0
ファイル: ut_html_test_urls.py プロジェクト: Ashmita89/attic
def main():
  
  # Setup test environment
  testlib.setup_test_environment()
  testlib.setup_test_db()
  
  try:
    # Run tests
    get_pages_without_user_logged_in()
    get_pages_with_user_logged_in()
    
    print "All tests passed."
    
  finally:
    testlib.teardown_test_db()
    testlib.teardown_test_environment()
コード例 #8
0
def main():

    # Setup test environment
    testlib.setup_test_environment()
    testlib.setup_test_db()

    try:
        # Run tests
        get_pages_without_user_logged_in()
        get_pages_with_user_logged_in()

        print "All tests passed."

    finally:
        testlib.teardown_test_db()
        testlib.teardown_test_environment()
コード例 #9
0
def main():
  
  # Setup test environment
  testlib.setup_test_environment()
  testlib.setup_test_db()
  
  try:
    login_test_user()
    
    test_normal()
    test_get_vessel_list_throws_DoesNotExistError()
    test_get_vessel_list_throws_InvalidRequestError()
    test_renew_vessels_throws_InvalidRequestError()
    
    print "All tests passed."
    
  finally:
    testlib.teardown_test_db()
    testlib.teardown_test_environment()
コード例 #10
0
def main():

    # Setup test environment
    testlib.setup_test_environment()
    testlib.setup_test_db()

    try:
        login_test_user()

        test_normal()
        test_get_vessel_list_throws_DoesNotExistError()
        test_get_vessel_list_throws_InvalidRequestError()
        test_renew_vessels_throws_InvalidRequestError()

        print "All tests passed."

    finally:
        testlib.teardown_test_db()
        testlib.teardown_test_environment()
コード例 #11
0
ファイル: test_change_key.py プロジェクト: Ashmita89/attic
def main():
  
  # Setup test environment
  testlib.setup_test_environment()
  testlib.setup_test_db()
  
  try:
    login_test_user()
    
    test_regenerate_key()
    test_upload_key_no_file()
    test_upload_key_file()
    test_upload_key_file_empty_file()
    test_upload_key_file_invalid_key()
    
    print "All tests passed."
    
  finally:
    testlib.teardown_test_db()
    testlib.teardown_test_environment()
コード例 #12
0
def main():

    # Setup test environment
    testlib.setup_test_environment()
    testlib.setup_test_db()

    try:
        login_test_user()

        test_regenerate_key()
        test_upload_key_no_file()
        test_upload_key_file()
        test_upload_key_file_empty_file()
        test_upload_key_file_invalid_key()

        print "All tests passed."

    finally:
        testlib.teardown_test_db()
        testlib.teardown_test_environment()
コード例 #13
0
def main():

    # Setup test environment
    testlib.setup_test_environment()
    testlib.setup_test_db()

    try:
        login_test_user()

        test_normal()
        test_interface_throws_UnableToAcquireResourcesError()
        test_interface_throws_InsufficientUserResourcesError()
        test_blank_POST_data()
        test_invalid_POST_data_invalid_num()
        test_invalid_POST_data_invalid_env()

        print "All tests passed."

    finally:
        testlib.teardown_test_db()
        testlib.teardown_test_environment()
コード例 #14
0
ファイル: test_get_resources.py プロジェクト: Ashmita89/attic
def main():

    # Setup test environment
    testlib.setup_test_environment()
    testlib.setup_test_db()

    try:
        login_test_user()

        test_normal()
        test_interface_throws_UnableToAcquireResourcesError()
        test_interface_throws_InsufficientUserResourcesError()
        test_blank_POST_data()
        test_invalid_POST_data_invalid_num()
        test_invalid_POST_data_invalid_env()

        print "All tests passed."

    finally:
        testlib.teardown_test_db()
        testlib.teardown_test_environment()