/usr/lib/python3/dist-packages/social/tests/backends/test_yammer.py is in python3-social-auth 0.2.13-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | import json
from social.tests.backends.oauth import OAuth2Test
class YammerOAuth2Test(OAuth2Test):
backend_path = 'social.backends.yammer.YammerOAuth2'
expected_username = 'foobar'
access_token_body = json.dumps({
'access_token': {
'user_id': 1010101010,
'view_groups': True,
'modify_messages': True,
'network_id': 101010,
'created_at': '2013/03/17 16:39:56 +0000',
'view_members': True,
'authorized_at': '2013/03/17 16:39:56 +0000',
'view_subscriptions': True,
'view_messages': True,
'modify_subscriptions': True,
'token': 'foobar',
'expires_at': None,
'network_permalink': 'foobar.com',
'view_tags': True,
'network_name': 'foobar.com'
},
'user': {
'last_name': 'Bar',
'web_url': 'https://www.yammer.com/foobar/users/foobar',
'expertise': None,
'full_name': 'Foo Bar',
'timezone': 'Pacific Time (US & Canada)',
'mugshot_url': 'https://mug0.assets-yammer.com/mugshot/images/'
'48x48/no_photo.png',
'guid': None,
'network_name': 'foobar',
'id': 1010101010,
'previous_companies': [],
'first_name': 'Foo',
'stats': {
'following': 0,
'followers': 0,
'updates': 1
},
'hire_date': None,
'state': 'active',
'location': None,
'department': 'Software Development',
'type': 'user',
'show_ask_for_photo': True,
'job_title': 'Software Developer',
'interests': None,
'kids_names': None,
'activated_at': '2013/03/17 16:27:50 +0000',
'verified_admin': 'false',
'can_broadcast': 'false',
'schools': [],
'admin': 'false',
'network_domains': ['foobar.com'],
'name': 'foobar',
'external_urls': [],
'url': 'https://www.yammer.com/api/v1/users/1010101010',
'settings': {
'xdr_proxy': 'https://xdrproxy.yammer.com'
},
'summary': None,
'network_id': 101010,
'contact': {
'phone_numbers': [],
'im': {
'username': '',
'provider': ''
},
'email_addresses': [{
'type': 'primary',
'address': 'foo@bar.com'
}],
'has_fake_email': False
},
'birth_date': '',
'mugshot_url_template': 'https://mug0.assets-yammer.com/mugshot/'
'images/{width}x{height}/no_photo.png',
'significant_other': None
},
'network': {
'show_upgrade_banner': False,
'header_text_color': '#FFFFFF',
'is_org_chart_enabled': True,
'name': 'foobar.com',
'is_group_enabled': True,
'header_background_color': '#396B9A',
'created_at': '2012/12/26 16:52:35 +0000',
'profile_fields_config': {
'enable_work_phone': True,
'enable_mobile_phone': True,
'enable_job_title': True
},
'permalink': 'foobar.com',
'paid': False,
'id': 101010,
'is_chat_enabled': True,
'web_url': 'https://www.yammer.com/foobar.com',
'moderated': False,
'community': False,
'type': 'network',
'navigation_background_color': '#38699F',
'navigation_text_color': '#FFFFFF'
}
})
def test_login(self):
self.do_login()
def test_partial_pipeline(self):
self.do_partial_pipeline()
|