Commit Graph

20 Commits (db131264090b7c41c53ca993c553437808695fe5)

Author SHA1 Message Date
NaveenKarippai ce2d322f09 HelpLine: Remove obsolete test cases and cache
The cache should be disabled as users from different locations will
get different results for the same query (basically location enabled
IA should have cache disabled). The test cases should be cleaned by
removing obsolete test cases from the suite.

* obsolete test cases removed

* cache disabled
2016-06-14 19:47:53 +00:00
NaveenKarippai 34ff2f032d Add test cases for a multitude of query and change cache definition
The code coverage will be complete when there are test cases for a multitude
of queries. Also, as the goodie always return the same set of results for the
trigger query - cache can be set.

* cache set

* added test cases
2016-06-09 17:34:22 +00:00
NaveenKarippai c1ce7ecaf2 Add test cases to the suite on HelpLine goodie
There should be more tests cases added to the suite for code coverage.
PR 3096 was merged before completion of test suite and it has to be
completed.

* test cases added
2016-06-08 21:11:38 +00:00
NaveenKarippai 8ca89d0961 Update test suite to match modified goodie file
The test suite should be modified to match the modified goodie
file for list template.

* prototype of test cases written

See also: #2840
2016-06-06 16:13:05 +00:00
Rob Emery bf232e70d5 HelpLine: Using Test::Deep 2016-05-16 20:53:04 +01:00
Rob Emery a8071eb7ed HelpLine: Updating tests to use Test::Deep and text template 2016-05-16 20:53:04 +01:00
Ben Moon 83b9bbd6b7 Fix newline at end of file 2016-05-16 14:19:39 +01:00
Ben Moon 5f85cf4121 Update Goodies to use Test::Deep
* Ensure Test::Deep is imported.

* Replace '-ANY-' with ignore()

* Replace regexes with re(...)
2016-05-16 14:07:57 +01:00
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