Exemple #1
0
    def test_all(my):
        # start batch environment
        Batch()
        from pyasm.web.web_init import WebInit
        WebInit().execute()


        sample3d_test_env = Sample3dEnvironment()
        sample3d_test_env.create()


        test_env = UnittestEnvironment()
        test_env.create()



        db_res = DbResource.get_default('unittest')
        sql = DbContainer.get(db_res)
        impl = sql.get_database_impl()
        db_type = impl.get_database_type()
        if db_type == "PostgreSQL":
            my.prefix = '''"unittest"."public".'''
            my.sthpw_prefix = '''"sthpw"."public".'''
        elif db_type == "Sqlite":
            my.prefix = ""
            my.sthpw_prefix = ""
        else:
            my.prefix = '''"unittest".'''
            my.sthpw_prefix = '''"sthpw".'''




        my.transaction = Transaction.get(create=True)
        try:

            my.person = Person.create( "5", "a",
                    "ComputerWorld", "1")
            my.person = Person.create( "4", "b",
                    "ComputerWorld", "3")
            my.person = Person.create( "3", "c",
                    "ComputerWorld", "3")
            my.person = Person.create( "2", "d",
                    "ComputerWorld", "4") 
            my.person = Person.create( "1", "e",
                    "ComputerWorld", "5") 


            my._test_no_id()

            my._test_order_by()                               
            my._test_search_key()
            my._test_search()

            my._test_multi_db_subselect()

            # FIXME: this requires sample3d project
            #my._test_search_other_project()
            my._test_search_type()
            my._test_metadata()
            my._test_search_type_existence()
            my._test_project()
            my._test_search_filter()
            my._test_dates_search()
            my._test_child_search()
            my._test_parent_search()
            my._test_add_column_search()
            my._test_commit()
            my._test_set_value()
            my._test_search_set_value()
            my._test_get_by_statement()
        finally:
            my.transaction.rollback()
            Project.set_project('unittest')

            test_env.delete()
            sample3d_test_env.delete()