Commits

Ian Lewis committed 844bee9

Added twitter tests

Comments (0)

Files changed (3)

lifestream/fixtures/twitter.json

+[
+    {
+        "pk": 401, 
+        "model": "lifestream.feed", 
+        "fields": {
+            "lifestream": 1, 
+            "name": "Twitter / IanMLewis", 
+            "url": "http://127.0.0.1:8097/feeds/rss/twitter_user.xml",
+            "domain": "twitter.com", 
+            "fetchable": 1, 
+            "plugin_class_name": "lifestream.plugins.twitter.TwitterPlugin" 
+        }
+    }
+] 

lifestream/tests/feed_tests.py

         update_feeds()
         self.assertEqual(Item.objects.filter(feed__pk=301).count(), 15)
 
+class TwitterTest(FeedTest):
+    fixtures = FeedTest.fixtures + ["twitter.json"]
+
+    def test_twitter_user_rss(self):
+        update_feeds()
+        self.assertEqual(Item.objects.filter(feed__pk=401).count(), 20)
+
 class RegressionFeedTest(FeedTest):
     fixtures = FeedTest.fixtures + ["regressions.json"]
 

lifestream/tests/feeds/rss/twitter_user.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
+  <channel>
+    <title>Twitter / IanMLewis</title>
+    <link>http://twitter.com/IanMLewis</link>
+    <atom:link type="application/rss+xml" href="http://twitter.com/statuses/user_timeline/13127822.rss" rel="self"/>
+    <description>Twitter updates from Ian Lewis / IanMLewis.</description>
+    <language>en-us</language>
+    <ttl>40</ttl>
+  <item>
+    <title>IanMLewis: @jespern yah inspect is awesome</title>
+    <description>IanMLewis: @jespern yah inspect is awesome</description>
+    <pubDate>Thu, 12 Nov 2009 12:56:46 +0000</pubDate>
+    <guid>http://twitter.com/IanMLewis/statuses/5648179182</guid>
+    <link>http://twitter.com/IanMLewis/statuses/5648179182</link>
+  </item>
+  <item>
+    <title>IanMLewis: @ryanmark If you would like your changes incorporated into the next version of pyaws let me know.</title>
+    <description>IanMLewis: @ryanmark If you would like your changes incorporated into the next version of pyaws let me know.</description>
+    <pubDate>Thu, 12 Nov 2009 06:50:13 +0000</pubDate>
+    <guid>http://twitter.com/IanMLewis/statuses/5643187895</guid>
+    <link>http://twitter.com/IanMLewis/statuses/5643187895</link>
+  </item>
+  <item>
+    <title>IanMLewis: @joestump A little late but: http://bit.ly/1l7V2p</title>
+    <description>IanMLewis: @joestump A little late but: http://bit.ly/1l7V2p</description>
+    <pubDate>Thu, 12 Nov 2009 06:16:23 +0000</pubDate>
+    <guid>http://twitter.com/IanMLewis/statuses/5642679227</guid>
+    <link>http://twitter.com/IanMLewis/statuses/5642679227</link>
+  </item>
+  <item>
+    <title>IanMLewis: @yuroyoro &#12379;&#12387;&#12363;&#12367;&#12394;&#12398;&#12391;&#12289;Tornado&#12420;&#12387;&#12383;&#12411;&#12358;&#12364;&#12356;&#12356;&#12391;&#12375;&#12423;&#12358;</title>
+    <description>IanMLewis: @yuroyoro &#12379;&#12387;&#12363;&#12367;&#12394;&#12398;&#12391;&#12289;Tornado&#12420;&#12387;&#12383;&#12411;&#12358;&#12364;&#12356;&#12356;&#12391;&#12375;&#12423;&#12358;</description>
+    <pubDate>Thu, 12 Nov 2009 06:10:28 +0000</pubDate>
+    <guid>http://twitter.com/IanMLewis/statuses/5642583457</guid>
+    <link>http://twitter.com/IanMLewis/statuses/5642583457</link>
+  </item>
+  <item>
+    <title>IanMLewis: Retweet&#27231;&#33021;&#12383;&#12417;&#12375;&#12390;&#12415;&#12383;&#12356;&#12394;</title>
+    <description>IanMLewis: Retweet&#27231;&#33021;&#12383;&#12417;&#12375;&#12390;&#12415;&#12383;&#12356;&#12394;</description>
+    <pubDate>Thu, 12 Nov 2009 06:04:54 +0000</pubDate>
+    <guid>http://twitter.com/IanMLewis/statuses/5642492405</guid>
+    <link>http://twitter.com/IanMLewis/statuses/5642492405</link>
+  </item>
+  <item>
+    <title>IanMLewis: @key3 &#20693;&#12399;&#20250;&#31038;&#12395;&#12356;&#12394;&#12356;&#12398;&#12391;&#27531;&#24565;</title>
+    <description>IanMLewis: @key3 &#20693;&#12399;&#20250;&#31038;&#12395;&#12356;&#12394;&#12356;&#12398;&#12391;&#27531;&#24565;</description>
+    <pubDate>Thu, 12 Nov 2009 05:56:30 +0000</pubDate>
+    <guid>http://twitter.com/IanMLewis/statuses/5642346257</guid>
+    <link>http://twitter.com/IanMLewis/statuses/5642346257</link>
+  </item>
+  <item>
+    <title>IanMLewis: &#20250;&#31038;&#12395;&#34892;&#12367;&#12363;&#12356;&#65311; RT @key3 &#33655;&#29289;&#31309;&#12415;&#36796;&#12415;done &#12456;&#12499;&#12473;&#12395;&#21521;&#12363;&#12358;</title>
+    <description>IanMLewis: &#20250;&#31038;&#12395;&#34892;&#12367;&#12363;&#12356;&#65311; RT @key3 &#33655;&#29289;&#31309;&#12415;&#36796;&#12415;done &#12456;&#12499;&#12473;&#12395;&#21521;&#12363;&#12358;</description>
+    <pubDate>Thu, 12 Nov 2009 05:38:13 +0000</pubDate>
+    <guid>http://twitter.com/IanMLewis/statuses/5642031259</guid>
+    <link>http://twitter.com/IanMLewis/statuses/5642031259</link>
+  </item>
+  <item>
+    <title>IanMLewis: Dear developers, please don't write python programs/libraries as if you are writing Java. Thnksby</title>
+    <description>IanMLewis: Dear developers, please don't write python programs/libraries as if you are writing Java. Thnksby</description>
+    <pubDate>Thu, 12 Nov 2009 05:09:32 +0000</pubDate>
+    <guid>http://twitter.com/IanMLewis/statuses/5641501256</guid>
+    <link>http://twitter.com/IanMLewis/statuses/5641501256</link>
+  </item>
+  <item>
+    <title>IanMLewis: @shohu33 &#12399;&#26397;&#20307;&#25805;&#12420;&#12387;&#12390;&#12427;</title>
+    <description>IanMLewis: @shohu33 &#12399;&#26397;&#20307;&#25805;&#12420;&#12387;&#12390;&#12427;</description>
+    <pubDate>Thu, 12 Nov 2009 00:21:04 +0000</pubDate>
+    <guid>http://twitter.com/IanMLewis/statuses/5634407354</guid>
+    <link>http://twitter.com/IanMLewis/statuses/5634407354</link>
+  </item>
+  <item>
+    <title>IanMLewis: RT @gvanrossum: Survey: Python Use Up 45% http://bit.ly/3oEBMI</title>
+    <description>IanMLewis: RT @gvanrossum: Survey: Python Use Up 45% http://bit.ly/3oEBMI</description>
+    <pubDate>Wed, 11 Nov 2009 23:24:21 +0000</pubDate>
+    <guid>http://twitter.com/IanMLewis/statuses/5632879704</guid>
+    <link>http://twitter.com/IanMLewis/statuses/5632879704</link>
+  </item>
+  <item>
+    <title>IanMLewis: From a user's perspective flash is neat, but developing a page that interacts with flash content is really frustrating.</title>
+    <description>IanMLewis: From a user's perspective flash is neat, but developing a page that interacts with flash content is really frustrating.</description>
+    <pubDate>Wed, 11 Nov 2009 09:23:12 +0000</pubDate>
+    <guid>http://twitter.com/IanMLewis/statuses/5614650833</guid>
+    <link>http://twitter.com/IanMLewis/statuses/5614650833</link>
+  </item>
+  <item>
+    <title>IanMLewis: Retweeting is dumb. What I want is to be able to reply to tweets and have them shown together.</title>
+    <description>IanMLewis: Retweeting is dumb. What I want is to be able to reply to tweets and have them shown together.</description>
+    <pubDate>Wed, 11 Nov 2009 07:41:35 +0000</pubDate>
+    <guid>http://twitter.com/IanMLewis/statuses/5613334864</guid>
+    <link>http://twitter.com/IanMLewis/statuses/5613334864</link>
+  </item>
+  <item>
+    <title>IanMLewis: @kazunori_279 &#12356;&#12369;&#12394;&#12356;&#12394;&#12290;&#27531;&#24565;</title>
+    <description>IanMLewis: @kazunori_279 &#12356;&#12369;&#12394;&#12356;&#12394;&#12290;&#27531;&#24565;</description>
+    <pubDate>Wed, 11 Nov 2009 07:40:14 +0000</pubDate>
+    <guid>http://twitter.com/IanMLewis/statuses/5613316645</guid>
+    <link>http://twitter.com/IanMLewis/statuses/5613316645</link>
+  </item>
+  <item>
+    <title>IanMLewis: @kenji_rikitake Not at all. Mostly web/application programmers.</title>
+    <description>IanMLewis: @kenji_rikitake Not at all. Mostly web/application programmers.</description>
+    <pubDate>Wed, 11 Nov 2009 03:46:44 +0000</pubDate>
+    <guid>http://twitter.com/IanMLewis/statuses/5609292595</guid>
+    <link>http://twitter.com/IanMLewis/statuses/5609292595</link>
+  </item>
+  <item>
+    <title>IanMLewis: Programmers specializing on one language are quickly going the way of the dinosaur.</title>
+    <description>IanMLewis: Programmers specializing on one language are quickly going the way of the dinosaur.</description>
+    <pubDate>Wed, 11 Nov 2009 02:30:56 +0000</pubDate>
+    <guid>http://twitter.com/IanMLewis/statuses/5607534337</guid>
+    <link>http://twitter.com/IanMLewis/statuses/5607534337</link>
+  </item>
+  <item>
+    <title>IanMLewis: &#35686;&#23519;&#12417;&#12385;&#12419;&#12367;&#12385;&#12419;&#22810;&#12356;</title>
+    <description>IanMLewis: &#35686;&#23519;&#12417;&#12385;&#12419;&#12367;&#12385;&#12419;&#22810;&#12356;</description>
+    <pubDate>Wed, 11 Nov 2009 02:03:31 +0000</pubDate>
+    <guid>http://twitter.com/IanMLewis/statuses/5606864003</guid>
+    <link>http://twitter.com/IanMLewis/statuses/5606864003</link>
+  </item>
+  <item>
+    <title>IanMLewis: @VinnieOlivieri Works both ways. The child of two mothers would get confused and say &quot;which one?&quot;</title>
+    <description>IanMLewis: @VinnieOlivieri Works both ways. The child of two mothers would get confused and say &quot;which one?&quot;</description>
+    <pubDate>Wed, 11 Nov 2009 01:53:14 +0000</pubDate>
+    <guid>http://twitter.com/IanMLewis/statuses/5606606657</guid>
+    <link>http://twitter.com/IanMLewis/statuses/5606606657</link>
+  </item>
+  <item>
+    <title>IanMLewis: So many iPhone apps justnreak down when on the subway. That should be part of the testing cycle.</title>
+    <description>IanMLewis: So many iPhone apps justnreak down when on the subway. That should be part of the testing cycle.</description>
+    <pubDate>Wed, 11 Nov 2009 01:50:31 +0000</pubDate>
+    <guid>http://twitter.com/IanMLewis/statuses/5606539400</guid>
+    <link>http://twitter.com/IanMLewis/statuses/5606539400</link>
+  </item>
+  <item>
+    <title>IanMLewis: &#20250;&#31038;&#12395;&#21521;&#12363;&#12358;</title>
+    <description>IanMLewis: &#20250;&#31038;&#12395;&#21521;&#12363;&#12358;</description>
+    <pubDate>Wed, 11 Nov 2009 01:32:19 +0000</pubDate>
+    <guid>http://twitter.com/IanMLewis/statuses/5606094539</guid>
+    <link>http://twitter.com/IanMLewis/statuses/5606094539</link>
+  </item>
+  <item>
+    <title>IanMLewis: &#36229;&#30130;&#12428;&#12383;</title>
+    <description>IanMLewis: &#36229;&#30130;&#12428;&#12383;</description>
+    <pubDate>Tue, 10 Nov 2009 12:04:39 +0000</pubDate>
+    <guid>http://twitter.com/IanMLewis/statuses/5586885824</guid>
+    <link>http://twitter.com/IanMLewis/statuses/5586885824</link>
+  </item>
+  </channel>
+</rss>