On May 30, 5:43 pm, Hans Lellelid <[email protected]> wrote:
> On May 30, 5:40 pm, Wyatt Baldwin <[email protected]> wrote:
>
> > On May 30, 2:31 pm, Eugueny Kontsevoy <[email protected]> wrote:
>
> > > They work, but we needed to have our existing 0.9.7 Pylons applications to
> > > work and they don't access config objects via TestResponse. In fact 90% of
> > > our tests are units, i.e. they don't issue request/response, they just do
> > > "from pylons import config" and test business logic in isolation from
> > > request/response machinery.
>
> > Going a little off-topic here, but in my view, business logic
> > generally shouldn't rely on Web app configuration.
>
> That's both unhelpful to the discussion and nonsensical.  

Well, that's, like, your opinion, man, but I happen to think
differently. The way that it might be helpful is that when you run
unit tests against your business logic, if you don't try use
pylons.config, that particular issue would go away (since, presumably,
any necessary config would be pulled from elsewhere).

Depending on the app, this level of separation might not be necessary,
or it might be too complex, but it's not nonsensical.


> In practice
> "business logic" can easily depend on configurable parameters.  E.g.
> I'd like a test to ensure my account gets locked out after X failed
> login attempts.  X is configurable.

I agree with you here. What I said was that *business logic* shouldn't
rely on *Web* configuration. Now, what gets defined as "business
logic" versus "Web logic" is certainly debatable (to an extent).
Personally, I wouldn't refer to logging in to a Web app as "business
logic".

That said, I don't really know what Eugeney meant by "business logic",
which is why I just threw out my suggestion as a possible avenue for
exploration.


> I've griped about this before, but I think the biggest (only?) problem
> that comes up repeatedly for us w/ Pylons is the inaccessibility of
> these "special" globals from tests (without using response/request
> objects).  Stacked object proxies.  I dream of a day (or a fork) when
> these are either a thing of the past, or disabled by default.  (Mike
> has given me some pointers in the past, but I still maintain that
> writing tests shouldn't be so hard. -- and one shouldn't be forced to
> use the WebTest framework, which IMO is inadequate for services
> applications.)
>
> Hans

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to