aboutsummaryrefslogtreecommitdiffstats
path: root/_pytest
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Match nicks with parenthesis and/or unicode (#649)pasja2018-11-031-0/+37
| | | | | | | | * Fix for #570, also incorporates #545 * Fixes from the review * review fix #2
* Fix test_everything.py failing by handling events in orderEric Wang2018-10-201-1/+1
|
* Merge pull request #462 from ericdwang/shared-channelsTrygve Aaberge2018-06-271-0/+8
|\ | | | | Add support for shared channels
| * Add support for shared channelsEric Wang2018-06-071-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since shared channels only work with the new conversations API, a new class of SlackChannel and API type were added to support them. Also `rtm.start` doesn't include external users so their information needs to be fetched individually when getting the channel history. To distinguish external users from team members their nicks get appended with an asterisk, which can be changed with a new setting. They also appear in a new "External" group in the nicklist since their presences can't be fetched with `users.getPresence`. Unfortunately `conversations.history` doesn't include thread messages so threads won't show up in shared channels.
* | Don't raise exception on missing event callbacks (#589)Trygve Aaberge2018-06-113-71/+13
| | | | | | | | | | These missing callbacks are not really errors or exceptions, and we don't need to implement all of them. Raising an exception makes the users think something isn't working, and is confusing.
* | print `image_url` if it exists (#504)Charlie Allom2018-06-081-0/+15
|/ | | | | | | | | | | | | | | | | | | | * print `image_url` if it exists * add test for image_url * requirements.txt for pytest * fix requirements.txt * text before image_url * this isn’t required * README readability for development section thanks @trygveaa * README reorder for this development section
* Re-add support for weechat.look.nick_{prefix,suffix}Tollef Fog Heen2018-03-111-0/+4
| | | | Fixes: #428
* Merge pull request #444 from trygveaa/feat/unfurl-prevent-auto-linkingTrygve Aaberge2018-01-141-1/+24
|\ | | | | feat: Remove Slacks auto prefixing of url protocols
| * test: Add tests for unfurl_auto_link_displayTrygve Aaberge2017-10-011-1/+24
| |
* | Merge pull request #438 from trygveaa/attachment-tests-and-minor-fixesTrygve Aaberge2018-01-101-0/+150
|\ \ | | | | | | Attachment tests and minor fixes
| * | fix: Unescape html before checking attachment linksTrygve Aaberge2017-10-151-3/+3
| | | | | | | | | | | | | | | | | | The title and from_url fields of attachments doesn't seem to be escaped, so the check if they already are in the text didn't work if the link contained e.g. an ampersand.
| * | Add a newline between attachmentsTrygve Aaberge2017-09-201-0/+22
| | |
| * | Don't render equal title_link and from_url in attachments twiceTrygve Aaberge2017-09-201-0/+13
| | | | | | | | | | | | | | | | | | | | | This is a follow-up of commit 0345ba1. That prevented rendering the link if it already was in the text. This prevents rendering both the title_link and from_url if they are equal, but not in the text. In this case it only renders the title_link.
| * | test: Add tests for unwrap_attachmentsTrygve Aaberge2017-09-201-0/+115
| |/
* | Create a decorator for decoding function argumentsTrygve Aaberge2017-10-191-0/+13
| |
* | Add tests for decode_from_utf8/encode_to_utf8Trygve Aaberge2017-10-191-0/+59
| |
* | test: Add tests for topic_command_cbTrygve Aaberge2017-10-081-1/+53
| |
* | test: Map all weechat return codes in testsTrygve Aaberge2017-10-081-1/+3
| | | | | | | | | | So we can assert on all of the return values. Since True == 1 in python, this doesn't change the value of WEECHAT_RC_OK.
* | refactor: Split topic_command_cb and add testsTrygve Aaberge2017-10-081-0/+44
|/ | | | | | Split out the parts of topic_command_cb that's most interesting and easiest to test into parse_topic_command and add tests for that function.
* Merge pull request #434 from trygveaa/test/fix-broken-testsTollef Fog Heen2017-09-188-9/+10
|\ | | | | Fix broken tests
| * test: Remove monkeypatch dependencyTrygve Aaberge2017-09-156-6/+6
| | | | | | | | As far as I can see, this isn't used anywhere.
| * test: Fix two incorrect test namesTrygve Aaberge2017-09-152-2/+2
| |