jadolg / rocketchat_API

@@ -69,6 +69,18 @@
Loading
69 69
            "channels.removeOwner", roomId=room_id, userId=user_id, kwargs=kwargs
70 70
        )
71 71
72 +
    def channels_add_leader(self, room_id, user_id, **kwargs):
73 +
        """Gives the role of Leader for a user in the current channel."""
74 +
        return self.call_api_post(
75 +
            "channels.addLeader", roomId=room_id, userId=user_id, kwargs=kwargs
76 +
        )
77 +
78 +
    def channels_remove_leader(self, room_id, user_id, **kwargs):
79 +
        """Removes the role of Leader for a user in the current channel."""
80 +
        return self.call_api_post(
81 +
            "channels.removeLeader", roomId=room_id, userId=user_id, kwargs=kwargs
82 +
        )
83 +
72 84
    def channels_archive(self, room_id, **kwargs):
73 85
        """Archives a channel."""
74 86
        return self.call_api_post("channels.archive", roomId=room_id, kwargs=kwargs)

@@ -7,7 +7,7 @@
Loading
7 7
8 8
@pytest.fixture(autouse=True)
9 9
def add_owner(logged_rocket, user):
10 -
    "Add test user as owner in GENERAL channel in every test in this module"
10 +
    """Add test user as owner in GENERAL channel in every test in this module"""
11 11
    logged_rocket.channels_add_owner("GENERAL", username=user.name)
12 12
13 13
@@ -112,6 +112,19 @@
Loading
112 112
        logged_rocket.channels_add_owner(room_id="GENERAL")
113 113
114 114
115 +
def test_channels_add_and_remove_leader(logged_rocket, testuser_id):
116 +
    channels_invite = logged_rocket.channels_invite("GENERAL", testuser_id).json()
117 +
    assert channels_invite.get("success")
118 +
    channels_add_leader = logged_rocket.channels_add_leader(
119 +
        "GENERAL", user_id=testuser_id
120 +
    ).json()
121 +
    assert channels_add_leader.get("success"), channels_add_leader.get("error")
122 +
    channels_remove_leader = logged_rocket.channels_remove_leader(
123 +
        "GENERAL", user_id=testuser_id
124 +
    ).json()
125 +
    assert channels_remove_leader.get("success"), channels_remove_leader.get("error")
126 +
127 +
115 128
def test_channels_archive_unarchive(logged_rocket):
116 129
    channels_archive = logged_rocket.channels_archive("GENERAL").json()
117 130
    assert channels_archive.get("success")
Files Coverage
rocketchat_API 98.52%
tests 99.31%
Project Totals (33 files) 99.00%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading