why not use a high speed database like an in-memory SQLite db for running
your tests ?



一首诗 wrote:
>
> I am using SqlAlchemy and I used to access database directly from
> business layer directly by calling SqlAlchemy API.
>
> But then I found that would cause too much time to run all my test
> cases and now I think maybe I should create a DB access layer, so I
> can use mock objects during test instead of access database directly.
>
> I think there are 2 choices to do that :
>
>    1.
>
>       use a single class which contains a DB connection and many
> methods like addUser/delUser/updateUser, addBook/delBook/updateBook.
> But this means this class will be very large.
>    2.
>
>       Another approach is create different manager classes like
> "UserManager", "BookManager". But that means I have to pass a list of
> managers to Business layer, which seems a little Cumbersome.
>
> How will you organize a database layer?
>
> >
>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to