Exemple #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()
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()
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()
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()
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()
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()
Exemple #7
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()
Exemple #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()
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()
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()
Exemple #11
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()
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()
Exemple #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()
Exemple #14
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()