Commit graph

1183 commits

Author SHA1 Message Date
derAnfaenger 6db062ef75 api: Display help on wrong command-line arguments.
Fixes #93.
2017-08-29 14:18:53 -07:00
Abhijeet Kaur 5a426fa841 bots: Converter bot does not require a config file.
Remove unnecessary file.
2017-08-29 14:04:16 -07:00
Abhijeet Kaur fec14ca286 bots: Add additional check to avoid ambiguous case.
If a user provides both the name and the path to the bot
as input then we either will have to chose one of them
or alert the user to check the input. Selecting the latter
by sending an error message to the user.
2017-08-29 14:04:16 -07:00
Abhijeet Kaur dd13d0314b bots: Improve code-style by using 'return' once. 2017-08-29 14:04:16 -07:00
Abhijeet Kaur 402dda87fe bots: Mock 'send_message' function for 'zulip-bot-output'.
Very few bots like followup bot directly call 'send_message'
function from the bot code. Since ExternalBotHandler class is
mocked, we'll have to mock 'send_message' function as well.

Added dummy field value of 'sender_email' for the message to be
as followup bot requires that field while processing
the message.
Since send_message is directly called from a specific bot's code,
so it can be sent to a different stream or under a different topic
than that of the incoming message. So, print the entire message
along with stream name.

A bot calling 'send_reply' function will reply to the incoming
message in the same stream under the same topic. So, only printing
bot's response message content for that.
2017-08-29 14:04:13 -07:00
Abhijeet Kaur 36f4982e54 bots: Mock get_config_info function for get-bot-output.
Since ExternalBotHandler class is mocked, few bots that
require specific configurations require to run get_config_info.
2017-08-29 13:58:05 -07:00
Abhijeet Kaur 23f6d2f144 bots: Add manual command to get bot output.
This eliminates the need to setup dev environment and to
create a bot, setup zuliprc file, subscribe the bot to the
stream in order to try out a bot.

Manual command get-bot-output gives the bots response content
directly.
2017-08-29 13:58:05 -07:00
derAnfaenger 689addc5bf zulip_botserver: Add skeleton config file for supervisord. 2017-08-29 09:53:34 -07:00
derAnfaenger 26a774503b twitter bots: Write internal config to separate file.
Tweaked by tabbott to remove duplicate write_config lines.

Fixes #88.
2017-08-27 19:27:13 -07:00
derAnfaenger 6c47eda92b definition bot: Clarify error message. 2017-08-25 10:01:44 +02:00
derAnfaenger 5671dba71e provision: Add venvs to .gitignore. 2017-08-25 09:31:01 +02:00
Tim Abbott 1c1286824f provision: Use sys.version_info for Python version. 2017-08-24 12:38:20 -07:00
Tim Abbott ed774fafcb provision: Fix usage to not have line-wrapping issues. 2017-08-24 12:38:14 -07:00
derAnfaenger 0984eae9b5 provision: Rewrite in Python. 2017-08-24 12:32:55 -07:00
Tim Abbott 5bc98bfdf7 send_message: Remove unnecessary API key details.
This removes a lot of clutter from this example.

This is the send_message part of #1.
2017-08-24 10:58:29 -07:00
Alex Dehnert 5eaac7bfba api: Use requests.Session.
Using requests.Session allows the requests library to reuse HTTP
connections, which is potentially helpful for performance.

Fixes #3.
2017-08-24 10:39:42 -07:00
neiljp (Neil Pilgrim) 749356d34b Incrementor tests: Preliminary coverage with no update_message support. 2017-08-24 10:24:41 -07:00
neiljp (Neil Pilgrim) d8c4242053 VirtualFS tests: Improve test coverage. 2017-08-24 10:24:41 -07:00
neiljp (Neil Pilgrim) 37206db176 TicTacToe tests: Improve test coverage. 2017-08-24 10:24:41 -07:00
derAnfaenger b3fc7edcf7 git: Ignore automatically generated MANIFEST.in. 2017-08-24 10:01:53 -07:00
Tim Abbott d42fa61dee test_lib: Clean up variable names. 2017-08-23 19:06:30 -07:00
neiljp (Neil Pilgrim) bef80129bd bot testing: Set check_expected_responses to test one source at a time.
When testing bots with state and using type="all", it is expected that
the passed-in state will be applied for each source individually.
This commit moves away from alternating between sources for each test,
to running all the tests on each source with a copy of state_handler.
2017-08-23 19:00:33 -07:00
neiljp (Neil Pilgrim) 2bd81eaff1 bot testing: Allow check_expected_responses to take Sequence[Tuple].
Ordered data is required for logical testing of stateful bots, as
compared to the previous use of a dict.
2017-08-23 19:00:33 -07:00
derAnfaenger 3e4d1fc02e requirements: Add coverage. 2017-08-23 16:41:02 +02:00
derAnfaenger cb017f22f7 travis: Simplify installation process. 2017-08-23 16:40:38 +02:00
derAnfaenger 81e6b01300 testing: Add build and coverage badges to README.md 2017-08-23 10:00:38 +02:00
Tim Abbott 9c18c0b4ed twitter: Fix buggy handling of config_file in Python 3.
This fixes the most broken part of #88.
2017-08-22 17:20:54 -07:00
Ahmad Jarara 409bb58742 api: set event_types to empty list if not supplied in register.
Previously, if you didn't specify a list of `event_types` in either `register` or `call_on_each_event`, you'd get an exception due to the invalid event format.

This fixes #86.
2017-08-22 16:33:10 -07:00
Abhijeet Kaur 83bfcb6535 bots: Modify is_private function to take 'id' as parameter.
This is done so that Embedded bot system can also make use of
this function directly, as only id is needed in this function.

Tweaked by tabbott to have a cleaner interface and simpler
documentation.
2017-08-22 12:03:09 -07:00
Abhijeet Kaur ae434cd26c bots: Use user 'id' instead of 'name' in is_private function.
Names are not guaranteed to be unique, user ids should
be used when comparing if the sender and receiver are the same.
2017-08-22 11:59:11 -07:00
derAnfaenger 735943379f provision: Add option to specify python version. 2017-08-22 11:39:11 -07:00
derAnfaenger a4d6c4700f provision: Refactor script variables and Windows support. 2017-08-22 11:39:11 -07:00
derAnfaenger 095cea7ab9 codecov: Document line capture issue in code. 2017-08-22 11:42:57 +02:00
derAnfaenger a5708e4dde testing: Add code test coverage reporting.
Fixes #38.
2017-08-21 15:03:47 -07:00
derAnfaenger 95021ebd56 testing: Add script for executing zulip_botserver tests. 2017-08-21 15:03:47 -07:00
derAnfaenger f5d01826f2 travis: Split test jobs into two files. 2017-08-21 15:03:47 -07:00
Tim Abbott e1758945de bots: Extract some functions to top-level.
We'll want to use these functions for the embedded bots system.
2017-08-17 10:53:39 -07:00
Tim Abbott 0eecf05226 provision: Fix detection of Windows. 2017-08-17 10:47:49 -07:00
Tim Abbott 2f7968e860 provision: Use 'cp -a' for copying requirements.txt.
It's generally best to preserve the metadata when copying files.
2017-08-17 10:47:00 -07:00
Tim Abbott 5e4c65f325 provision: Print out the command needed to activate venv. 2017-08-17 10:46:36 -07:00
Tim Abbott a744fd9316 provision: Fix shell quoting and whitespace. 2017-08-17 10:43:50 -07:00
Rohitt Vashishtha 3b95af3b63 tools: Add virtual-env path exception for CygWin. 2017-08-17 10:43:50 -07:00
Rohitt Vashishtha 4cd580d4fe tools: Diff with requirements.txt in tools/provision. 2017-08-17 10:43:50 -07:00
Eeshan Garg dcaace2a88 README: Add instructions for setting up a development environment. 2017-08-17 10:43:23 -07:00
Eeshan Garg f2687056b4 README: Add links to zulip_bots, zulip_botserver packages. 2017-08-17 10:39:00 -07:00
Eeshan Garg f9655266df python-zulip-api: Add tools/provision for setting up dev env. 2017-08-17 10:39:00 -07:00
derAnfaenger e4c34d77e7 packaging: Automatically generate zulip_bots MANIFEST.in.
Fixes #69.
2017-08-17 10:09:24 -07:00
derAnfaenger e1d1c490c8 Split too long line in server_lib/README.md. 2017-08-17 10:06:31 -07:00
derAnfaenger 14ebc24f59 travis: Move linter to a separate job. 2017-08-17 10:06:31 -07:00
Eeshan Garg 7460aca3e5 zulip_bots: Format string before checking if logo file exists.
get_bot_logo_path now first formats the path string with the name
of the bot before checking if the path exists. Not doing so is a
bug and causes the function to always return None.
2017-08-16 17:18:06 -07:00