zulip/zerver/tests/fixtures
Steve Howell d64d1c81a4 tests: Eliminate narrow.json fixture.
In 2484d870b4 I created tests
using a fixture called narrow.json.  I believe my intention
was to eventually use the fixture for similar tests on the
frontend, but that never happened.

Almost seven years later, I think it's time to just use
straightforward code in Python to test build_narrow_filter.
In particular, we want to move to dataclasses, so that would
create an addition nuisance for fixture-based tests.  The
fixture was already annoying in terms of being an extra moving
part, being hard to read, and not being type-safe.

In order to avoid typos, I mostly code-generated the new
Python code by instrumenting the old test:

                 narrow_filter = build_narrow_filter(narrow)
    +            print("###\n")
    +            print(f"narrow_filter = build_narrow_filter({narrow})\n")
                 for e in accept_events:
                     message = e["message"]
                     flags = e["flags"]
    @@ -610,6 +612,8 @@ class NarrowLibraryTest(ZulipTestCase):
                     if flags is None:
                         flags = []
                     self.assertTrue(narrow_filter(message=message, flags=flags))
    +                print(f"self.assertTrue(narrow_filter(message={message}, flags={flags},))")
    +            print()
                 for e in reject_events:
                     message = e["message"]
                     flags = e["flags"]
    @@ -618,6 +622,8 @@ class NarrowLibraryTest(ZulipTestCase):
                     if flags is None:
                         flags = []
                     self.assertFalse(narrow_filter(message=message, flags=flags))
    +                print(f"self.assertFalse(narrow_filter(message={message}, flags={flags},))")
    +            print()

I then basically pasted the output in and ran black to format it.
2023-06-29 12:35:55 -07:00
..
apple tests: Rename APPLE_JWK to a generic name for re-use in other tests. 2021-05-23 13:30:17 -07:00
email emails: Inline CSS in emails in build_email. 2023-04-05 12:22:29 -07:00
import_fixtures
ldap tests: Update tests to use example profile picture. 2022-10-31 14:36:54 -07:00
mattermost_fixtures data_import: Add import attachments support for Mattermost. 2021-07-02 11:19:45 -07:00
rocketchat_fixtures data_import: Ignore Rocket.Chat livechat streams/messages. 2021-11-07 09:50:55 -08:00
saml saml: Implement SP-initiated Logout. 2023-05-23 13:01:15 -07:00
slack_fixtures import: Add the UTF-8 flag on file entries in zipfiles from Slack. 2023-01-31 16:07:48 -08:00
.gitignore
authors.json team: Rename contrib to contributors in page_params. 2020-07-23 10:22:28 -07:00
config.generate_data.json docs: Correct more “webapp” to “web app”. 2022-09-08 20:23:28 -07:00
csp_report.json
example_jwk tests: Rename APPLE_JWK to a generic name for re-use in other tests. 2021-05-23 13:30:17 -07:00
gitter_data.json gitter: Soft deactivate appropriate imported users. 2022-08-29 11:03:27 -07:00
markdown_test_cases.json Fix typos caught by typos. 2023-01-03 11:09:50 -08:00
slack_message_conversion.json
user_agents_unique