Commit Graph

18052 Commits

Author SHA1 Message Date
derAnfaenger 5480f6fd0f 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 5ed6c29ccf 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
Steve Howell 4cfd9aa689 Add test coverage for activity unread counts. 2017-05-24 13:08:54 -07:00
Steve Howell 4a062d47a6 Add more features to zjquery. 2017-05-24 13:08:54 -07:00
Steve Howell 884d9d1a2d Simplify unread count display logic in buddy list.
This commit de-couples the PM code from Group code.  It also
simplified some code related to finding parent elements by
both introducing local variables and removing unnecessary
selectors.
2017-05-24 13:07:33 -07:00
Rick Chern e53d1c3885 tests: Remove get_user_profile_by_email from most tests. 2017-05-24 13:05:19 -07:00
root e809faa37d docs: Document /users/me/subscriptions API endpoint. 2017-05-24 12:49:08 -07:00
Vishnu Ks 4403d179df tests: Replace mit_user().email with mit_email(). 2017-05-24 12:44:43 -07:00
Tim Abbott e5f5e5c69f tests: Remove unnecessary maxDiff settings.
Now that ZulipTestCase does this, we don't need it in all these
individual test modules.
2017-05-24 12:43:28 -07:00
umkay ccc70445d6 mypy: Fix strict-optional errors for test files.
Fix mypy --strict-optional errors in zerver/tests
2017-05-24 12:43:28 -07:00
Tim Abbott 17328a7557 tests: Fix incorrect use of get_realm_by_email_domain. 2017-05-24 12:43:28 -07:00
Cynthia Lin 344f284431 user docs: Document Streams menu hotkeys.
Also includes refactoring to **Keyboard shortcuts** user docs.
2017-05-24 12:19:15 -07:00
Cynthia Lin 2045426ab9 hotkeys: Change subscribe stream hotkey to `S`. 2017-05-24 12:19:15 -07:00
Cynthia Lin 6993f8900a subs: Focus in Filter streams input when menu is first opened. 2017-05-24 12:19:15 -07:00
Tim Abbott 895d4a795b mypy: Fix a missing type annotation. 2017-05-24 12:14:13 -07:00
Krzysztof Krzysztof 75794acc46 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
Mahim Goyal 44ff978ecb docs: Add a mounting shared folder error for vagrant.
I faced this problem many a times, might be of help to
beginners. Because, the same thing doesn't work when done through
`vagrant suspend` followed by `vagrant up`.
2017-05-24 11:54:00 -07:00
Yago González 40fa0f64f6 docs: Fix indentation. 2017-05-24 11:41:49 -07:00
Yago González bd5fba4a64 docs: Fix inheritance in /messages/{message_id}. 2017-05-24 11:41:49 -07:00
Yago González 55664b1a93 docs: Fix JsonResponse definition. 2017-05-24 11:41:49 -07:00
Nick Dickey 6ac13a0f0d docs: Document /messages API endpoint. 2017-05-24 11:41:49 -07:00
Umair Khan 9a04fef71b testing: Reset active language.
After running translation tests, we should reset the active
language to isolate the change
2017-05-24 11:35:17 -07:00
Umair Khan ebb9bd1a6a testing: Avoid class variables to enforce isolation.
Class variables are shared between all instances and as a result
changes made by one instance are leaked to other instances.
2017-05-24 11:35:12 -07:00
derAnfaenger 169f1e35b8 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 0b2969a363 bots: Dedup rate limiting error code. 2017-05-24 11:01:47 -07:00
derAnfaenger 188f313e15 bots: Allow bots to update messages. 2017-05-24 11:01:46 -07:00
Tim Abbott 8aaf9b1426 Revert "Fix emoji cache setup when not using provision.py."
This reverts commit ab2cfadcaa.

This broke production installation.
2017-05-24 10:35:41 -07:00
Yago González c0f2036435 api: Handle unregistered users in dev_fetch_api_key.
Fixes #4851.
2017-05-24 09:39:44 -07:00
Steve Howell d5d6d47287 Fix unread counts for Group PMs.
The variable name "name" was completely wrong, and I guess
this never generated a traceback or lint error.
2017-05-24 09:18:24 -07:00
Steve Howell a9f6f5f0c0 node tests: Split out presence.js. 2017-05-24 09:18:24 -07:00
Umair Khan 603b60940d github: Access private emails.
Previously our scope setting only allowed us access to
publicly listed email addresss. This commit changes that
to get access to private email addresses as well.

Fixes: #4937.
2017-05-24 08:24:26 -07:00
Mehanig 6038777891 npm: Upgrade webpack to 2.0 version dev and production. 2017-05-23 23:58:25 -07:00
Andrew Archer 67cf4c4fb4 test_alert_words: Remove use of get_user_profile_by_email. 2017-05-23 22:14:10 -07:00
Eklavya Sharma 2314c0fb1b tools/minify-js: Improve type checking.
* Use Optional where needed.
* Add type to variables because otherwise it'll be Any.
2017-05-23 22:02:41 -07:00
Eklavya Sharma b805e0ca10 mypy: Assert non-Noneness.
Convince mypy that an object cannot be None by using an assert.
2017-05-23 21:56:50 -07:00
Eklavya Sharma 13ee26019f zproject/backends.py: Check for None before use.
Check if the dict 'return_data' is None before setting attributes
on it.
2017-05-23 21:56:50 -07:00
Eklavya Sharma bac874b7e3 mypy: Allow None in passwords while creating users. 2017-05-23 21:56:50 -07:00
Eklavya Sharma 7636972a6c mypy: Wrap return value in Optional. 2017-05-23 21:56:50 -07:00
Eklavya Sharma cc1937c8d5 mypy: Use Optional with strings where required. 2017-05-23 21:56:50 -07:00
Eklavya Sharma 481d14df39 mypy: Remove a type: ignore.
https://github.com/python/typeshed/pull/693 was merged.
2017-05-23 21:56:48 -07:00
kb0rg eb2d0ebd09 Add test for do_deactivate_realm exit if deactivated.
Rename existing test_do_deactivate_realm to indicate test purpose
is to confirm user realm cache clears when a realm is deactivated.
2017-05-23 21:38:07 -07:00
kb0rg e672ec62c1 Add test for encode_email_address with empty Gateway. 2017-05-23 21:38:07 -07:00
kb0rg d625cca2f8 minor: Rename test class -> TestEmptyGatewaySetting. 2017-05-23 21:38:07 -07:00
vaibhav f94c321567 Outgoing Webhook System: Add support for personal message triggers. 2017-05-23 21:35:09 -07:00
Tim Abbott ed82f6f3d0 contrib_bots: Fix lint errors in virtual_fs.py. 2017-05-23 21:35:09 -07:00
neiljp a859dadd29 contrib_bots: Clean up and document virtual_fs bot. 2017-05-23 21:04:34 -07:00
Lech Kaiel 6b49e667ef tests: Replaced @zulip.com references with self.example_ functions.
This cleans up the excessive use of @zulip.com emails in the tests.
2017-05-23 20:59:50 -07:00
Abhijeet Kaur aa576d83b0 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
Brian Tenazas 9d485a0415 docs: Document /streams API endpoint. 2017-05-23 20:37:51 -07:00
Yago González 9f329f6597 docs: Fix JsonSuccess and JsonError models. 2017-05-23 20:37:51 -07:00