|
19 | 19 |
|
20 | 20 | def connect_debug(): |
21 | 21 | return stream.connect( |
22 | | - 'gav9ygr75by3', |
23 | | - '5ws2hnua79n9qga6e2dy572qdfapwgdc83853mjm3mjp66czyb2xkahbdhs98an8', |
| 22 | + '2a7ug7h97y6v', |
| 23 | + 'rg24qz8qtqq2dqqejushqt7m8v7fzrnkad6xmu2b9e3ejrjb7wabktyvgenu3car', |
24 | 24 | location='us-east', |
25 | 25 | timeout=10 |
26 | 26 | ) |
@@ -309,6 +309,17 @@ def test_follow_and_source(self): |
309 | 309 | activity_id_found = activity['id'] if activity is not None else None |
310 | 310 | self.assertEqual(activity['origin'], feed.id) |
311 | 311 | self.assertEqual(activity_id_found, activity_id) |
| 312 | + |
| 313 | + def test_follow_activity_copy_limit(self): |
| 314 | + feed = getfeed('user', 'test_follow_acl') |
| 315 | + feed1 = getfeed('user', 'test_follow_acl1') |
| 316 | + actor_id = random.randint(10, 100000) |
| 317 | + feed1.add_activity({ 'actor': actor_id, 'verb': 'tweet', 'object': 1 }) |
| 318 | + feed.follow(feed1.slug, feed1.user_id, activity_copy_limit=0) |
| 319 | + time.sleep(10) |
| 320 | + activities = feed.get(limit=5)['results'] |
| 321 | + |
| 322 | + self.assertEqual(len(activities), 0) |
312 | 323 |
|
313 | 324 | def test_follow_and_delete(self): |
314 | 325 | user_feed = getfeed('user', 'test_follow') |
@@ -690,6 +701,22 @@ def test_follow_many(self): |
690 | 701 | self.assertEqual(follows[0]['feed_id'], source) |
691 | 702 | self.assertIn(follows[0]['target_id'], targets) |
692 | 703 |
|
| 704 | + def test_follow_many_acl(self): |
| 705 | + sources = [getfeed('user', str(i)) for i in range(10)] |
| 706 | + targets = [getfeed('flat', str(i)) for i in range(10)] |
| 707 | + sources_id = [source.id for source in sources] |
| 708 | + targets_id = [target.id for target in targets] |
| 709 | + feeds = [{'source': s, 'target': t} for s,t in zip(sources_id, targets_id)] |
| 710 | + |
| 711 | + for target in targets: |
| 712 | + target.add_activity({ 'actor': 'barry', 'object': '09', 'verb': 'tweet' }) |
| 713 | + |
| 714 | + self.c.follow_many(feeds, activity_copy_limit=0) |
| 715 | + |
| 716 | + for source in sources: |
| 717 | + activities = source.get(limit=5)['results'] |
| 718 | + self.assertEqual(len(activities), 0) |
| 719 | + |
693 | 720 | def test_add_to_many(self): |
694 | 721 | activity = {'actor': 1, 'verb': 'tweet', 'object': 1, 'custom': 'data'} |
695 | 722 | feeds = [getfeed('flat', str(i)).id for i in range(10, 20)] |
|
0 commit comments