IRC log of #schooltool for Tuesday, 2008-06-17

*** didymo has joined #schooltool00:44
*** th1a_ has joined #schooltool03:13
*** th1a has quit IRC03:16
*** th1a_ has quit IRC05:54
*** didymo has quit IRC06:13
*** th1a has joined #schooltool06:49
*** aelkner_ has joined #schooltool07:44
*** aelkner__ has quit IRC08:01
*** didymo has joined #schooltool08:18
*** Ninno has joined #schooltool08:23
*** Ninno has quit IRC08:24
*** tdoggette has joined #schooltool13:40
*** alga has joined #SchoolTool13:43
*** ignas has joined #schooltool14:07
*** tdoggette has quit IRC15:14
*** didymo has quit IRC15:22
*** ignas has quit IRC15:39
*** ignas has joined #schooltool15:46
*** mgedmin has joined #schooltool16:01
*** tdoggette has joined #schooltool16:19
*** alga has quit IRC16:25
th1aLumiere: How many schools are using CanDo now and how many are planned for next year?16:32
*** alga has joined #SchoolTool17:00
*** tdoggette has quit IRC17:21
aelkner_hey ignas17:56
th1aHow's it coming aelkner_?18:00
aelkner_not bad18:00
aelkner_i have the test framework up and have tested some of the moethods18:00
th1aGood.18:00
aelkner_i wanted ignas' thoughts on one issue18:00
th1aWhen does the school year end at SLA?18:00
aelkner_namely, the authenticate method needs to contact the CAS server with a urlopn call18:01
aelkner_i think i'll need to replace that with a utility18:01
aelkner_and the test will supply a dummy response18:01
th1aYes.18:01
aelkner_it could return yes for one user and no for another18:01
aelkner_that would excersize the different paths through authenticate18:02
th1aYeah.  That's what you want.18:02
aelkner_the school year at SLA?18:04
aelkner_i don't know the exact date18:04
th1aRoughly?18:04
aelkner_chris told me i didn't need to come18:04
aelkner_weds anymore18:04
aelkner_i'm guessing this week or next18:04
th1aAh, ok.18:04
ignasaelkner_: seems to make sense18:16
aelkner_i'll utility will have a validate method that receives the requrl18:17
aelkner_the live one will do the urlopen, read, and split18:17
aelkner_and return the result18:17
ignascan't tell without seeing the actual code, sorry18:17
aelkner_if you look at the authenticate method as you have it18:18
aelkner_i'm replacing the urlopen line with18:18
aelkner_result = getUtility(ICASValidate).validate(requrl)18:18
ignasmakes sense I guess18:19
aelkner_the fake utility can return ['yes', 'frog'] for ticket 'good_ticket'18:19
aelkner_and ['no', ''] for any other ticket18:19
ignasmaybe you should come up with a better abstraction?18:20
ignaslike return None or user itself18:20
ignasfor example18:20
ignasthe utility should do the yes/no checking18:20
ignasand return either None or the principal18:20
aelkner_but then we don't have an ability to unit test18:20
aelkner_that's why i want to abstract only the interaction with the server18:20
ignaswe have, you can just overlay the methof18:20
ignasthat does urlopen18:20
aelkner_and let our code that parses the result18:21
ignasthat would be in the utility18:21
aelkner_oh18:21
aelkner_so in my test, i create an instance of the live utility18:22
aelkner_replace it's open method with a fake one18:22
aelkner_that returns ['yes', 'frog']18:22
ignasyeah, something like that would do18:22
ignasmaybe not a list18:22
aelkner_but the validate method returns the princiapal18:22
ignasbut a string18:22
ignasleave the "splitting" part to the rest of the code18:23
ignaseither the principal18:23
ignasor the id18:23
ignasor you can just make a method that does the urlopen18:23
ignasin the CAS utility18:23
ignasand overlay *that* method18:23
ignasinstead of adding one more utility18:23
aelkner_ah, yes18:23
aelkner_even simpler18:24
aelkner_so to reitterate18:29
aelkner_i'm going to replace18:29
aelkner_result = urllib.urlopen(requrl).read().split('\n')18:29
aelkner_with18:29
aelkner_            contactResult = self.contactCAS(requrl)18:30
aelkner_            result = contactResult.split("\n")18:30
aelkner_and create method18:30
aelkner_    def contactCAS(self, requrl):18:30
aelkner_        return urllib.urlopen(requrl).read()18:30
aelkner_then i overlay that method in my test18:30
aelkner_with a method that returns 'yes\nfrog'18:31
aelkner_for good_ticket18:31
aelkner_and 'no\n'' for bad_ticket18:31
aelkner_ignas: does that sound right?18:31
ignascontactCAS is a bit too abstract as a name18:47
ignasi18:47
ignasi'd just call it _urlopen18:47
ignaswith a docstring of "hook for unit tests" for example18:47
ignasbut it works i guess ...18:47
*** tdoggette has joined #schooltool18:49
aelkner_ignas: cold you explain me something you did in authenticate?19:53
aelkner_i have one path through the method to test, when ticket is not set, but CAS is19:54
aelkner_it calls storeCredentials(request, None)19:55
aelkner_which sets the authenticated value to True in session, but does nothing to the principal19:56
aelkner_what is the thinking here?19:56
aelkner_i need to know in order come up with a narrative for my test19:57
ignaswell20:02
ignasthere is a usecase for "anonymous" user20:02
ignassomeone who is "nobody"20:02
ignasso that you could see school calendar for example20:02
ignaseven with CAS enabled20:02
ignaseven though you don't have CAS login20:02
*** ignas has quit IRC21:35
*** aelkner__ has joined #schooltool22:20
*** aelkner_ has quit IRC22:22
*** tdoggette has quit IRC22:24
*** mgedmin has quit IRC22:34

Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!