Commit Graph

12 Commits (194556f7388ca778528cde59aa8d4989e33e893f)

Author SHA1 Message Date
Matt Miller fd1c66408d HelpLine: add structured answer.
Also, restructure data sources to make it easier for non-technical
people to contribute.
2014-11-15 21:32:59 +02:00
Matt Miller d7b5501d5d HelpLine.t: do not construct a test plan.
We're not actually getting a test count from test_zci. Someday soon this
will reconcile exactly with the number of `test_zci` calls you make, but
it clearly does not today (see the extra 2 factor).

Rather than try to predict which version is running these tests, remove
the plan for now.
2014-10-05 17:18:37 +02:00
Matt Miller 68fc7c8dec Set explicit caching everywhere.
This explicity sets the caching behavior for all goodies. Goodies which
did not have caching behavior set in their package have had it added.
Similarly for the tests.

This resulted in a number of changes for caching behavior, mostly
moving towards more frequent caching.

I identified three cases where goodies should not be cached. They are when
the result depends upon:

- some random element,
- the time of day or year (as with relative dates), or
- the location of the requesting user

In all other cases, I presumed that the goodies were sufficiently
deterministic in their output to warrant caching.
2014-09-27 10:35:17 -04:00
Jag Talon 7be1572e8a HelpLine: Update tests. 2014-01-29 15:27:28 -05:00
Jag Talon a1276aab68 Helpline: Remove Canada from the tests. 2014-01-24 00:40:17 -05:00
Jag Talon 545e2c44c0 Helpline: Fix tests. 2014-01-24 00:21:43 -05:00
Dylan Lloyd 48297fc42e added international help lines & updated tests
for country in `perl ../zeroclickinfo-spice/lib/DDG/Spice/Zipcode.pm`;
    do curl "http://www.befrienders.org/directory?country=$country" 2>/dev/null
        | tee tmp
        | egrep 'There are <strong>[1-9]\d* helplines' >/dev/null
            || continue;
        foo="`
            sed -nr 's/.*Helpline 1:<\/strong>\s+([-()0-9 ]+[0-9]).*/\1/p' tmp
                | head -n1`";
        [[ ! -z "$foo" ]]
            && perl -e "print uc \"$country\", ' => \'', \"$foo',\n\"";
done;
2013-06-26 16:05:18 -04:00
Dylan Lloyd a2d2cd6c63 more comprehensive testing for HelpLine 2013-06-24 14:33:56 -04:00
Dylan Lloyd 76dfbebe23 quote test locations "just in case" 2013-06-21 17:20:03 -04:00
Dylan Lloyd 09719f5d77 test all query/location permutations and declare expected tests 2013-06-21 17:19:06 -04:00
Dylan Lloyd ae66d35d8c abstract helpline tests for geoip location based testing 2013-06-21 17:04:04 -04:00
Dylan Lloyd 8fda7647e3 wrote HelpLine test file 2013-06-21 16:35:10 -04:00