aboutsummaryrefslogtreecommitdiffstats
path: root/_pytest
Commit message (Collapse)AuthorAgeFilesLines
* Support newlines in the /topic commandTrygve Aaberge2020-04-191-0/+7
| | | | Fixes #728
* Include files in attachmentsTrygve Aaberge2020-04-051-0/+16
|
* Include footer in attachmentsTrygve Aaberge2020-04-051-0/+35
|
* Don't add fallback if link exists in text_beforeTrygve Aaberge2020-04-051-0/+24
| | | | | | | | We should only use the fallback if we don't get any information out of the attachment. For links that exists in text_before, we have gotten the information from the attachment, but choose not to display it so we don't end up with duplicate links. Therefore, we shouldn't use the fallback in this case.
* Match attachment links against escaped text as wellTrygve Aaberge2020-04-051-0/+15
| | | | | The urls in the attachment fields can apparently come both escaped and unescaped.
* Don't print image_url if it's equal to from_urlTrygve Aaberge2020-04-051-0/+16
|
* Ignore ref fallback if it's equal to the refTrygve Aaberge2020-04-051-0/+5
| | | | | Prevents showing "http://some.url (http://some.url)" if the url has a fallback which is equal to the url.
* Add tests for unfurl_auto_link_display with mailtoTrygve Aaberge2020-04-051-0/+15
|
* Reply to parent message if trying to reply to thread messageTrygve Aaberge2020-03-181-0/+25
| | | | | | | | | | | | | | | Opening a thread on a thread message is not possible, so the logical thing to do if a user tries to reply to a thread message is to put the message in the same thread as the message that is replied to. Slack currently has a bug which causes thread messages to be converted to normal messages if you try to reply to them (that is, send a message with thread_ts set to the ts of the thread message), but the message you reply with will end up in the original thread. I filed an issue and they confirmed that it is a bug, and that you should not send messages with thread_ts set to the ts of a thread message. Fixes #751
* Pass team/channel to handle/process methods directlyTrygve Aaberge2020-02-231-2/+2
|
* Include team in SlackRequestTrygve Aaberge2020-02-231-1/+1
|
* Cleanup/simplify callback functionsTrygve Aaberge2020-02-238-10/+10
|
* Fix tests for python 2Trygve Aaberge2020-02-211-3/+4
|
* Make tests work when the timezone is set to UTCTrygve Aaberge2020-02-211-7/+11
| | | | | | | | | | Unfortunately, the date tests of the last commit only work in one time zone. This changes them to work in UTC. If your machine doesn't use UTC, you now have to run the tests like this: TZ=UTC pytest I'm not sure what the best way to avoid requiring this is.
* Support parsing date refsTrygve Aaberge2020-02-211-3/+31
|
* Support unfurling date refs by using the fallbackTrygve Aaberge2020-02-201-0/+4
|
* Only use fallback for refs if ref is not foundTrygve Aaberge2020-02-201-7/+27
| | | | | | Fallbacks in messages are not changed when channels/users/groups are renamed, so they shouldn't be used unless the ref can't be found. Links are not refs we look up, so they are still treated the same way.
* Remove ignore_alt_text parameter from unfurl_refsTrygve Aaberge2020-02-201-4/+2
| | | | | This is only used in tests and in render_topic, and I don't see why render_topic shouldn't follow the global config that is set.
* Remove auto_link_display parameter from unfurl_refsTrygve Aaberge2020-02-201-2/+2
| | | | | This is only used in tests, and there we can override the config instead.
* Use max of submessages and replies for number_of_repliesTrygve Aaberge2019-10-031-0/+37
| | | | | | | | | When new replies come in over websocket, we don't update the message_json of the parent message with the new replies, we just append the new message to the submessages list. Therefore, the number_of_replies function has to check both of these and take the max. Fixes #722
* Add basic support for private channels converted from publicTrygve Aaberge2019-10-011-0/+44
| | | | | | | | | | | | | | | | | | This is for channels which initially were public, but then are changed to private. They look the same as groups (channels initially created as private) in the official clients, but can only be used with the conversations api. They are listed in the channels list of rtm.start with is_private set to true. There are some remaining issues, which are documented in the readme. I'm not sure if we can support read sync and showing unread on load without changes from Slack to the API. Showing thread messages in the channel is possible to fix, but we would have to send requests to load the thread history for all the messages in the history that has replies. Fixes most of #644
* Remove url from rtm start test dataTrygve Aaberge2019-08-251-1/+1
| | | | So it doesn't try to connect to the websocket when running the tests.
* Refactor linkify_text to use re.subTrygve Aaberge2019-08-251-0/+5
| | | | | Instead of splitting the message at spaces and checking and replacing each word, use re.sub for the whole message.
* Support @everyone in linkify_textTrygve Aaberge2019-08-251-0/+5
|
* Add some more tests for linkify_textTrygve Aaberge2019-08-252-0/+39
|
* Render group notifications with @ instead of !Trygve Aaberge2019-08-251-0/+16
| | | | | | | | | This is for the notifications @channel, @everyone, @group and @here. @group isn't mentioned in the documentation[0], but it is still rendered as a highlight in the web client, so I included it. [0]: https://get.slack.help/hc/en-us/articles/202009646-Notify-a-channel-or-workspace
* Include channel prefix in key in get_channel_mapTrygve Aaberge2019-08-252-4/+4
| | | | Fixes #587
* Include @ in subteam handleTrygve Aaberge2019-08-252-3/+3
| | | | Subteams/usergroups should never be used without the @.
* Fallback to full name if display name is not setTrygve Aaberge2019-08-071-0/+2
| | | | | | | The username can't be changed by the users themselves now and is auto generated for new users, so we shouldn't use it. Only use username as a last resort if neither display name nor full name is set (I'm not sure this ever happens, it looks like the full name field is mandatory).
* Support topic changes for private channelsTrygve Aaberge2019-06-121-1/+1
| | | | Fixes #697
* Render "by invitation from" before reactionsTrygve Aaberge2019-06-021-1/+1
|
* Fix /topic command output (#691)luk13372019-05-291-1/+1
| | | | | * This change makes sure the /topic command outputs 'Topic for #random is ""' instead of 'Topic for #random is "{'value': ''}"'.
* Fix broken testsTrygve Aaberge2019-05-053-11/+7
| | | | | I forgot to make some required changes in the tests after commit f3d880e and commit 49d481c.
* Reconnect if no pong is received for 12 secondsTrygve Aaberge2019-04-231-2/+6
| | | | | | | 12 seconds is a bit more than twice the amount of time between the pings we send. Fixes #238, fixes #480, fixes #561
* Cleanup tests and make them compatible with python 3Trygve Aaberge2019-04-0814-254/+157
| | | | | | This mainly adds team, channel_general and user_alice as fixtures, so we can use those directly instead of picking arbitrary ones from the lists. It also adds assertions to some tests which where missing it.
* Delete testsTrygve Aaberge2019-04-086-126/+0
| | | | These tests don't do any assertions, so they are not very useful.
* Make encode_to/decode_from_utf8 noop in python 3Trygve Aaberge2019-04-081-49/+70
| | | | | | | Python 3 receives unicode strings as arguments in weechat callbacks, websocet receive etc. and we can send unicode strings to weechat functions, websocket etc., so we don't need to do any of this converting.
* Remember plugin config values in FakeWeechatSamuel Holland2019-04-081-3/+4
| | | | | | PluginConfig uses round-tripping through wee_slack.w to coerce the its default values to the correct type. Without this, the normal getters fail, as '' cannot be converted to an integer/boolean.
* Use StringIO from ioTrygve Aaberge2019-04-081-0/+2
| | | | | This is compatible with python 3, which StringIO from StringIO or cStringIO is not.
* Import print_function and unicode_literals in all test filesTrygve Aaberge2019-04-0823-13/+32
|
* Always use the print function from Python 3Samuel Holland2019-04-0813-58/+81
| | | | Comments are updated as well as live code.
* Don't serialize request metadataTrygve Aaberge2019-04-081-5/+5
| | | | | It seems pointless to serialize request metadata first with pickle, then pack it into json, just to unpack both afterwards.
* Delete useless testTrygve Aaberge2019-04-081-54/+0
| | | | | This test doesn't do any assertions, and is as far as I can see completely useless.
* Add @user-groups support (#680)Nana Amfo2019-04-087-2/+158
| | | Add @user-groups with tab-completion. @user-groups will be unfurl into format <!subteam^{ID}|handle> message before sending message via linktext method.
* Remove channel parameter from linkify_textTrygve Aaberge2019-04-031-15/+8
| | | | This parameter is not used in the function.
* Keep text directly after @channel/group/here when linkifyingTrygve Aaberge2019-04-021-0/+16
| | | | Previously, when writing e.g. `@channel: test` the colon would be lost.
* Add tests for preserving formatting in code blocksDavid Vo2019-01-251-0/+13
|
* Add tests for no formatting casesDavid Vo2019-01-251-0/+14
|
* Add apostrophe to the regex with a corresponding testPásztor János2018-11-121-0/+8
| | | | * fixes #618
* Store hdata structure in a classTrygve Aaberge2018-11-041-0/+1
| | | | Simplifies the usage so we don't have to look it up each time.