Commit graph

1024 commits

Author SHA1 Message Date
Abhijeet Kaur f4c2ed486c testsuite: Add tests for thesaurus bot in contrib_bots.
Add test file 'test_thesaurus.py'.
2017-05-28 17:12:11 -07:00
Abhijeet Kaur 9e653525cf bots: Remove unwanted spaces from 'help_message' in thesaurus bot.
Remove unwanted spaces from the file contrib_bots/bots/thesaurus/thesaurus.py,
these spaces were being stripped while being written to
zulip console.
2017-05-28 17:12:11 -07:00
Abhijeet Kaur 72fadda781 testsuite: Add tests for help bot in contrib_bots.
Add test file 'test_help.py'.
2017-05-28 17:12:11 -07:00
Abhijeet Kaur 9f4948c685 bots: Remove unnecessary split() function from help bot.
Remove unnecessary split() function from the file
contrib_bots/bots/help/help.py and replaced it with equivalent
simpler string.
2017-05-28 17:12:11 -07:00
Abhijeet Kaur a09ebc3b26 testsuite: Add tests for helloworld bot in contrib_bots.
Add test file 'test_helloworld.py'.
2017-05-28 17:12:11 -07:00
Abhijeet Kaur b1573babcb testsuite: Add tests for encrypt bot in contrib_bots.
Remove previous unittest file for encrypt bot. Add new
test file which is in accordance with the test-suite famework
developed for contrib_bots.
2017-05-28 17:12:11 -07:00
Abhijeet Kaur a52269cbe2 testsuite: Add tests for converter bot in contrib_bots.
Remove previous unittest file for converter bot. Add new
test file which is in accordance with the test-suite famework
developed for contrib_bots.

Since 'coverter' folder is now a package (addition of __init__.py),
modify converter.py to import utils.py from the same package.
2017-05-28 17:12:11 -07:00
Tim Abbott 5c18c75295 bots: Remove legacy bots/ directory. 2017-05-26 15:21:30 -07:00
Tim Abbott 0fd15bcd25 bots: Move log2zulip into api/integrations. 2017-05-26 15:15:56 -07:00
Tim Abbott 2025e01870 puppet: Remove obsolete zuliprc.nagios file.
This hasn't done anything for years.
2017-05-26 15:14:12 -07:00
Reid Barton 3dda07bad0 bots: Move zephyr-related files to api/integrations/zephyr/. 2017-05-26 15:07:02 -07:00
Reid Barton f0beaa3f1e bots: Move IRC and Jabber mirror scripts to api/integrations.
This is part of cleaning out the old bots/ top level directory.
2017-05-26 15:04:55 -07:00
derAnfaenger 8f2f2d220e bots: Add mypy annotations for bots framework.
This commit adds mypy annotations for both the main
bots and the bots testing runner. It involves a change
to the BotHandlerApi send_message and update_message
funtions, which is compatible with every bot.

Tweaked by tabbott to use more expressive annotations.
2017-05-26 10:25:06 -07:00
Tim Abbott bd4be69148 contrib_bots: Fix python 3 lint errors. 2017-05-26 10:18:40 -07:00
Reid Barton caf3ec3ca1 bots: Remove githook-post-receive link.
Based on commits cdedb8593 and 58a8934a8 it seems to be unused.
2017-05-25 18:05:35 -07:00
Reid Barton 839ada716d rss-bot: Add --unwrap, --math options.
These are for processing arXiv API results.
2017-05-25 16:24:07 -07:00
Elliott Jin dd71daa09f bots: Add __init__.py so bot modules can be imported. 2017-05-25 15:00:51 -07:00
Tim Abbott 971fabe8ad bots: Simplify automated testing library. 2017-05-24 20:13:25 -07:00
derAnfaenger a85c7a0705 bots: Simplify define bot test. 2017-05-24 19:44:22 -07:00
derAnfaenger 9b67e94ba8 bots: Fix unit tests not running in Vagrant.
`test-bots` would not run in Vagrant, displaying
the error "ValueError: no such test method in <class
'bots_test_lib.BotTestCase'>: runTest" This was due to
the `BotTestCase` class inheriting from the TestCase
class, even though it was not a unit test on its own.

This commit removes the inheritance of TestCase and
specifies `test_define` as the `runTest` method in
`TestDefineBot`.
2017-05-24 19:44:22 -07:00
Krzysztof Krzysztof 073468ebba bots: Add empty message support in Wikipedia bot. 2017-05-24 19:23:36 -07:00
derAnfaenger 4b9628eac0 bots: Make test-bots independent from current working path. 2017-05-24 17:34:11 -07:00
derAnfaenger e59b9ed897 bots: Make run.py independent from current working path. 2017-05-24 17:34:11 -07:00
Krzysztof Krzysztof 12e81fd024 bots: Add empty message support in Wikipedia bot. 2017-05-24 14:49:57 -07:00
derAnfaenger c6d294385f bots: Refactor bots to use send_reply.
The send_reply function makes it easier for bots
to send messages. This commit updates all bots to
make use of this function, when possible.
2017-05-24 13:16:23 -07:00
Abhijeet Kaur f83ddd658c tests: Add contrib_bots/test-bots file.
This test uses unittest and mock library. It mocks
'BotHandlerApi' class. This test works independent of
the rest of the code outside contrib_bots folder.

Merged with a few changes by tabbott to fix lint issues; we'll need to
do further work on this framework, but since it's not hooked up to
anything, it's reasonable to merge early so others can collaborate on
improving it.
2017-05-24 13:13:03 -07:00
Krzysztof Krzysztof b540c09768 bots: Correct weird behavior of followup bot for empty messages.
Before it sends an empty message to followup stream, now it sends a
help message back to the user/stream where it was mentioned.
2017-05-24 11:58:12 -07:00
derAnfaenger 854416b725 bots: Add incrementor bot.
This bot provides a sample implementation
for updating existing messages sent by the
bot.
2017-05-24 11:01:47 -07:00
derAnfaenger 6f88c2c9a2 bots: Dedup rate limiting error code. 2017-05-24 11:01:47 -07:00
derAnfaenger 45e0f77298 bots: Allow bots to update messages. 2017-05-24 11:01:46 -07:00
Tim Abbott bfb4ec78cc contrib_bots: Fix lint errors in virtual_fs.py. 2017-05-23 21:35:09 -07:00
neiljp 194ba1367b contrib_bots: Clean up and document virtual_fs bot. 2017-05-23 21:04:34 -07:00
Abhijeet Kaur 63efed5c73 Refactor: Make StateHandler() function independent.
This refactor makes the nested class 'StateHandler' in the
file /contrib_bots/bot_lib.py independent class. It previously
was nested in 'run_message_handler_for_bot' function.

This is done to write a cleaner test file for contrib_bots using
mock library.
2017-05-23 20:42:09 -07:00
Theodore Chen a8b825388d bots: Fix googlesearch bot exceptions and add readme. 2017-05-23 20:18:24 -07:00
derAnfaenger bb70c5beed bots: Fix converter bot.
The converter bot depended on past.utils.old_div,
which is not supported anymore. Updating the code
to use the // operator, which provides the same
functionality.
2017-05-23 20:13:29 -07:00
neiljp adb5f645bc contrib_bots: Update xkcd bot to use send_reply.
This enables private message usage.
2017-05-23 18:43:43 -07:00
neiljp 915d98aa68 contrib_bots: Remove triage_message() from help bot.
This completes removing triage_message from the tree.
2017-05-23 18:30:39 -07:00
neiljp ec0de2a7ff contrib_bots: Switch encrypt bot to use send_reply. 2017-05-23 17:32:51 -07:00
neiljp 9c637db2ec bots: Switch define bot to use send_reply. 2017-05-23 17:02:03 -07:00
neiljp 0606d7acad bots: Fix help bot replies in private chat, including 3+ users.
Also deduplicates the code.
2017-05-23 14:38:49 -07:00
Theodore Chen 9604ffca38 bots: Add helloworld example bot. 2017-05-23 13:15:21 -07:00
neiljp bd37161ece Factor out send_reply functionality into bot_lib 2017-05-23 12:40:08 -07:00
umkay 5252626095 mypy: Change type annotation to Set[bytes].
also fix unicode
2017-05-23 10:42:44 -07:00
neiljp ad25f27853 Update Wikipedia bot to reply to multiple user private chats. 2017-05-23 08:17:35 -07:00
Tim Abbott 657478cfc5 bot_lib: Fix indentation. 2017-05-23 08:17:22 -07:00
derAnfaenger 81cd41da17 bots: Strip leading whitespaces from bot queries. 2017-05-22 19:13:42 -07:00
derAnfaenger 374c80d86a bots: Clarify message handling for @-mentions. 2017-05-22 19:13:42 -07:00
derAnfaenger 60d4c343d7 bots: Allow empty bot queries.
This commit allows bots to be adressed with empty queries,
that is, by just @-mentioning them. @-mentioning is now the
only way to adress a bot.
2017-05-22 19:13:42 -07:00
Eeshan Garg 2d785ea3d1 api: Use the console_scripts entry point to point to zulip-send.
Instead of using the `scripts` keyword, we now use the
`console_scripts` entry point to point to the zulip-send script
to be installed. This is what the Python Packaging User Guide
recommends for better cross-platform compatibility.
2017-05-22 18:08:18 -07:00
Elliott Jin 9b20750456 bots: Allow symlinks in bot paths provided to run.py.
run.py requires that the location of the provided bot matches the location
of run.py.  However, run.py previously failed in the case where the location
included a symlink.
2017-05-22 16:52:29 -07:00