Coveralls logob
Coveralls logo
  • Home
  • Features
  • Pricing
  • Docs
  • Sign In

matrix-org / synapse / 4532

23 Sep 2019 - 19:39 coverage decreased (-49.7%) to 17.596%
4532

Pull #6079

buildkite

Richard van der Hoff
update changelog
Pull Request #6079: Add submit_url response parameter to msisdn /requestToken

359 of 12986 branches covered (2.76%)

Branch coverage included in aggregate %.

0 of 7 new or added lines in 1 file covered. (0.0%)

18869 existing lines in 281 files now uncovered.

8809 of 39116 relevant lines covered (22.52%)

0.23 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

19.35
/synapse/handlers/account_data.py
1
# -*- coding: utf-8 -*-
2
# Copyright 2015, 2016 OpenMarket Ltd
3
#
4
# Licensed under the Apache License, Version 2.0 (the "License");
5
# you may not use this file except in compliance with the License.
6
# You may obtain a copy of the License at
7
#
8
#     http://www.apache.org/licenses/LICENSE-2.0
9
#
10
# Unless required by applicable law or agreed to in writing, software
11
# distributed under the License is distributed on an "AS IS" BASIS,
12
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
# See the License for the specific language governing permissions and
14
# limitations under the License.
15

16
from twisted.internet import defer
1×
17

18

19
class AccountDataEventSource(object):
1×
20
    def __init__(self, hs):
1×
UNCOV
21
        self.store = hs.get_datastore()
!
22

23
    def get_current_key(self, direction="f"):
1×
UNCOV
24
        return self.store.get_max_account_data_stream_id()
!
25

26
    @defer.inlineCallbacks
1×
27
    def get_new_events(self, user, from_key, **kwargs):
UNCOV
28
        user_id = user.to_string()
!
UNCOV
29
        last_stream_id = from_key
!
30

UNCOV
31
        current_stream_id = yield self.store.get_max_account_data_stream_id()
!
32

UNCOV
33
        results = []
!
UNCOV
34
        tags = yield self.store.get_updated_tags(user_id, last_stream_id)
!
35

UNCOV
36
        for room_id, room_tags in tags.items():
Branches [[0, 37], [0, 41]] missed. !
UNCOV
37
            results.append(
!
38
                {"type": "m.tag", "content": {"tags": room_tags}, "room_id": room_id}
39
            )
40

UNCOV
41
        account_data, room_account_data = (
!
42
            yield self.store.get_updated_account_data_for_user(user_id, last_stream_id)
43
        )
44

UNCOV
45
        for account_data_type, content in account_data.items():
Branches [[0, 46], [0, 48]] missed. !
UNCOV
46
            results.append({"type": account_data_type, "content": content})
!
47

UNCOV
48
        for room_id, account_data in room_account_data.items():
Branches [[0, 49], [0, 54]] missed. !
UNCOV
49
            for account_data_type, content in account_data.items():
Branches [[0, 48], [0, 50]] missed. !
UNCOV
50
                results.append(
!
51
                    {"type": account_data_type, "content": content, "room_id": room_id}
52
                )
53

UNCOV
54
        return results, current_stream_id
!
55

56
    @defer.inlineCallbacks
1×
57
    def get_pagination_rows(self, user, config, key):
58
        return [], config.to_id
!
Troubleshooting · Open an Issue · Sales · Support · ENTERPRISE · CAREERS · STATUS
BLOG · TWITTER · Legal & Privacy · Supported CI Services · What's a CI service? · Automated Testing

© 2019 Coveralls, LLC