Add a test case for labs sample endpoint
Marked expected to fail in pytest, because it requires that the
application key used for testing has access to the correct labs
endpoints
@@ -639,3 +639,20 @@ def test_app_auth():
if count == 10:
break
assert count == 10
+
+
+@pytest.mark.xfail
+def test_labs_v1_sample():
+ ta = twarc.Twarc(app_auth=True)
+
+ collected = 0
+
+ for tweet in ta.labs_v1_sample():
+ if 'data' in tweet:
+ collected += 1
+
+ if collected == 100:
+ break
+
+ # reconnect to close streaming connection for other tests
+ ta.connect()
