OMG, more tests
authorTed Mielczarek <ted.mielczarek@gmail.com>
Thu, 20 Nov 2008 20:07:23 -0500
changeset 47 c61d975cece260152cbfcb39b1b48e28bba70ce8
parent 46 fced04046f583cb8b90a1c14035e51489a1d35f6
child 48 485bf1de78f969a2db4d22dd908deaf0da7a6dfd
push id21
push usertmielczarek@mozilla.com
push dateFri, 21 Nov 2008 01:07:30 +0000
OMG, more tests
runtests.py
testdata/test-repo-changeset-query-tipsonly-data.xml
testdata/test-repo-date-query-tipsonly-data.xml
testdata/test-repo-tipsonly-data.xml
--- a/runtests.py
+++ b/runtests.py
@@ -114,10 +114,28 @@ class TestPushlog(unittest.TestCase):
         self.assertEqualFeeds(testfeed, expectedfeed)
 
     def testchangesetqueryatom(self):
         """Get some ATOM data via pushlog changeset query."""
         testfeed = feedparser.parse("http://localhost:8000/pushlog?fromchange=4ccee53e18ac&tochange=a79451771352")
         expectedfeed = feedparser.parse(os.path.join(mydir, "testdata/test-repo-changeset-query-data.xml"))
         self.assertEqualFeeds(testfeed, expectedfeed)
 
+    def testtipsonlyatom(self):
+        """Get only the tips as ATOM data from pushlog?tipsonly=1."""
+        testfeed = feedparser.parse("http://localhost:8000/pushlog?tipsonly=1")
+        expectedfeed = feedparser.parse(os.path.join(mydir, "testdata/test-repo-tipsonly-data.xml"))
+        self.assertEqualFeeds(testfeed, expectedfeed)
+
+    def testpartialdatequerytipsonlyatom(self):
+        """Get some tipsonly ATOM data via pushlog date query."""
+        testfeed = feedparser.parse("http://localhost:8000/pushlog?startdate=2008-11-20%2010:52:25&enddate=2008-11-20%2010:53:25&tipsonly=1")
+        expectedfeed = feedparser.parse(os.path.join(mydir, "testdata/test-repo-date-query-tipsonly-data.xml"))
+        self.assertEqualFeeds(testfeed, expectedfeed)
+
+    def testchangesetquerytipsonlyatom(self):
+        """Get some tipsonly ATOM data via pushlog changeset query."""
+        testfeed = feedparser.parse("http://localhost:8000/pushlog?fromchange=4ccee53e18ac&tochange=a79451771352&tipsonly=1")
+        expectedfeed = feedparser.parse(os.path.join(mydir, "testdata/test-repo-changeset-query-tipsonly-data.xml"))
+        self.assertEqualFeeds(testfeed, expectedfeed)
+
 if __name__ == '__main__':
     unittest.main()
new file mode 100644
--- /dev/null
+++ b/testdata/test-repo-changeset-query-tipsonly-data.xml
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+ <id>http://shiny-thing.local:8000/pushlog</id>
+ <link rel="self" href="http://shiny-thing.local:8000/pushlog" />
+ <updated>2008-11-20T15:53:32Z</updated>
+ <title>hg-test Pushlog</title>
+ <entry>
+  <title>Changeset a79451771352e444711b99134174c5daa05db9cd</title>
+  <id>http://www.selenic.com/mercurial/#changeset-a79451771352e444711b99134174c5daa05db9cd</id>
+  <link href="http://shiny-thing.local:8000/rev/a79451771352e444711b99134174c5daa05db9cd" />
+  <updated>2008-11-20T15:53:32Z</updated>
+  <author>
+   <name>luser</name>
+  </author>
+  <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <ul class="filelist"><li class="file">testfile</li></ul>
+    </div>
+  </content>
+ </entry>
+ <entry>
+  <title>Changeset 0ea9c66e27948fde116fbaa141bb53e9f7c23359</title>
+  <id>http://www.selenic.com/mercurial/#changeset-0ea9c66e27948fde116fbaa141bb53e9f7c23359</id>
+  <link href="http://shiny-thing.local:8000/rev/0ea9c66e27948fde116fbaa141bb53e9f7c23359" />
+  <updated>2008-11-20T15:53:26Z</updated>
+  <author>
+   <name>luser</name>
+  </author>
+  <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <ul class="filelist"><li class="file">testfile</li></ul>
+    </div>
+  </content>
+ </entry>
+ <entry>
+  <title>Changeset 6437207053fb9701290b738d720044803436ba3e</title>
+  <id>http://www.selenic.com/mercurial/#changeset-6437207053fb9701290b738d720044803436ba3e</id>
+  <link href="http://shiny-thing.local:8000/rev/6437207053fb9701290b738d720044803436ba3e" />
+  <updated>2008-11-20T15:53:21Z</updated>
+  <author>
+   <name>luser</name>
+  </author>
+  <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <ul class="filelist"><li class="file">testfile</li></ul>
+    </div>
+  </content>
+ </entry>
+ <entry>
+  <title>Changeset 25f2a69ac7ac2919ef35c0b937b862fbb9e7e1f7</title>
+  <id>http://www.selenic.com/mercurial/#changeset-25f2a69ac7ac2919ef35c0b937b862fbb9e7e1f7</id>
+  <link href="http://shiny-thing.local:8000/rev/25f2a69ac7ac2919ef35c0b937b862fbb9e7e1f7" />
+  <updated>2008-11-20T15:53:16Z</updated>
+  <author>
+   <name>luser</name>
+  </author>
+  <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <ul class="filelist"><li class="file">testfile</li></ul>
+    </div>
+  </content>
+ </entry>
+ <entry>
+  <title>Changeset af5fb85d93246318a4050c4def448cbcfd068e57</title>
+  <id>http://www.selenic.com/mercurial/#changeset-af5fb85d93246318a4050c4def448cbcfd068e57</id>
+  <link href="http://shiny-thing.local:8000/rev/af5fb85d93246318a4050c4def448cbcfd068e57" />
+  <updated>2008-11-20T15:53:10Z</updated>
+  <author>
+   <name>luser</name>
+  </author>
+  <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <ul class="filelist"><li class="file">testfile</li></ul>
+    </div>
+  </content>
+ </entry>
+ <entry>
+  <title>Changeset 853ae4aff7ec183c47f8b9b08faff9f8f4083855</title>
+  <id>http://www.selenic.com/mercurial/#changeset-853ae4aff7ec183c47f8b9b08faff9f8f4083855</id>
+  <link href="http://shiny-thing.local:8000/rev/853ae4aff7ec183c47f8b9b08faff9f8f4083855" />
+  <updated>2008-11-20T15:53:05Z</updated>
+  <author>
+   <name>luser</name>
+  </author>
+  <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <ul class="filelist"><li class="file">testfile</li></ul>
+    </div>
+  </content>
+ </entry></feed>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/testdata/test-repo-date-query-tipsonly-data.xml
@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+ <id>http://shiny-thing.local:8000/pushlog</id>
+ <link rel="self" href="http://shiny-thing.local:8000/pushlog" />
+ <updated>2008-11-20T15:53:21Z</updated>
+ <title>hg-test Pushlog</title>
+ <entry>
+  <title>Changeset 6437207053fb9701290b738d720044803436ba3e</title>
+  <id>http://www.selenic.com/mercurial/#changeset-6437207053fb9701290b738d720044803436ba3e</id>
+  <link href="http://shiny-thing.local:8000/rev/6437207053fb9701290b738d720044803436ba3e" />
+  <updated>2008-11-20T15:53:21Z</updated>
+  <author>
+   <name>luser</name>
+  </author>
+  <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <ul class="filelist"><li class="file">testfile</li></ul>
+    </div>
+  </content>
+ </entry>
+ <entry>
+  <title>Changeset 25f2a69ac7ac2919ef35c0b937b862fbb9e7e1f7</title>
+  <id>http://www.selenic.com/mercurial/#changeset-25f2a69ac7ac2919ef35c0b937b862fbb9e7e1f7</id>
+  <link href="http://shiny-thing.local:8000/rev/25f2a69ac7ac2919ef35c0b937b862fbb9e7e1f7" />
+  <updated>2008-11-20T15:53:16Z</updated>
+  <author>
+   <name>luser</name>
+  </author>
+  <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <ul class="filelist"><li class="file">testfile</li></ul>
+    </div>
+  </content>
+ </entry>
+ <entry>
+  <title>Changeset af5fb85d93246318a4050c4def448cbcfd068e57</title>
+  <id>http://www.selenic.com/mercurial/#changeset-af5fb85d93246318a4050c4def448cbcfd068e57</id>
+  <link href="http://shiny-thing.local:8000/rev/af5fb85d93246318a4050c4def448cbcfd068e57" />
+  <updated>2008-11-20T15:53:10Z</updated>
+  <author>
+   <name>luser</name>
+  </author>
+  <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <ul class="filelist"><li class="file">testfile</li></ul>
+    </div>
+  </content>
+ </entry>
+ <entry>
+  <title>Changeset 853ae4aff7ec183c47f8b9b08faff9f8f4083855</title>
+  <id>http://www.selenic.com/mercurial/#changeset-853ae4aff7ec183c47f8b9b08faff9f8f4083855</id>
+  <link href="http://shiny-thing.local:8000/rev/853ae4aff7ec183c47f8b9b08faff9f8f4083855" />
+  <updated>2008-11-20T15:53:05Z</updated>
+  <author>
+   <name>luser</name>
+  </author>
+  <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <ul class="filelist"><li class="file">testfile</li></ul>
+    </div>
+  </content>
+ </entry>
+ <entry>
+  <title>Changeset 4ccee53e18ac923ff9ac995805748167128327a9</title>
+  <id>http://www.selenic.com/mercurial/#changeset-4ccee53e18ac923ff9ac995805748167128327a9</id>
+  <link href="http://shiny-thing.local:8000/rev/4ccee53e18ac923ff9ac995805748167128327a9" />
+  <updated>2008-11-20T15:53:00Z</updated>
+  <author>
+   <name>luser</name>
+  </author>
+  <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <ul class="filelist"><li class="file">testfile</li></ul>
+    </div>
+  </content>
+ </entry>
+ <entry>
+  <title>Changeset 7886a3f7fcba196c29bd9de0cc4d858cdc4910b9</title>
+  <id>http://www.selenic.com/mercurial/#changeset-7886a3f7fcba196c29bd9de0cc4d858cdc4910b9</id>
+  <link href="http://shiny-thing.local:8000/rev/7886a3f7fcba196c29bd9de0cc4d858cdc4910b9" />
+  <updated>2008-11-20T15:52:55Z</updated>
+  <author>
+   <name>luser</name>
+  </author>
+  <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <ul class="filelist"><li class="file">testfile</li></ul>
+    </div>
+  </content>
+ </entry>
+ <entry>
+  <title>Changeset e9ea8b142bf4e2aa230cbd46d68ec73f45c1e080</title>
+  <id>http://www.selenic.com/mercurial/#changeset-e9ea8b142bf4e2aa230cbd46d68ec73f45c1e080</id>
+  <link href="http://shiny-thing.local:8000/rev/e9ea8b142bf4e2aa230cbd46d68ec73f45c1e080" />
+  <updated>2008-11-20T15:52:49Z</updated>
+  <author>
+   <name>luser</name>
+  </author>
+  <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <ul class="filelist"><li class="file">testfile</li></ul>
+    </div>
+  </content>
+ </entry>
+ <entry>
+  <title>Changeset a19f3496dc6d46e9b22bda92676bb20bacd3124a</title>
+  <id>http://www.selenic.com/mercurial/#changeset-a19f3496dc6d46e9b22bda92676bb20bacd3124a</id>
+  <link href="http://shiny-thing.local:8000/rev/a19f3496dc6d46e9b22bda92676bb20bacd3124a" />
+  <updated>2008-11-20T15:52:44Z</updated>
+  <author>
+   <name>luser</name>
+  </author>
+  <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <ul class="filelist"><li class="file">testfile</li></ul>
+    </div>
+  </content>
+ </entry>
+ <entry>
+  <title>Changeset d091969e89a9581fd89f7ed0afce10aaaa0c24bf</title>
+  <id>http://www.selenic.com/mercurial/#changeset-d091969e89a9581fd89f7ed0afce10aaaa0c24bf</id>
+  <link href="http://shiny-thing.local:8000/rev/d091969e89a9581fd89f7ed0afce10aaaa0c24bf" />
+  <updated>2008-11-20T15:52:39Z</updated>
+  <author>
+   <name>luser</name>
+  </author>
+  <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <ul class="filelist"><li class="file">testfile</li></ul>
+    </div>
+  </content>
+ </entry>
+ <entry>
+  <title>Changeset 82883a615a97e9d5bd2083787fba2589dcfb4d7f</title>
+  <id>http://www.selenic.com/mercurial/#changeset-82883a615a97e9d5bd2083787fba2589dcfb4d7f</id>
+  <link href="http://shiny-thing.local:8000/rev/82883a615a97e9d5bd2083787fba2589dcfb4d7f" />
+  <updated>2008-11-20T15:52:33Z</updated>
+  <author>
+   <name>luser</name>
+  </author>
+  <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <ul class="filelist"><li class="file">testfile</li></ul>
+    </div>
+  </content>
+ </entry>
+ <entry>
+  <title>Changeset 1ab7868c33f5a8db756bfaaa4fef148af7a983e3</title>
+  <id>http://www.selenic.com/mercurial/#changeset-1ab7868c33f5a8db756bfaaa4fef148af7a983e3</id>
+  <link href="http://shiny-thing.local:8000/rev/1ab7868c33f5a8db756bfaaa4fef148af7a983e3" />
+  <updated>2008-11-20T15:52:28Z</updated>
+  <author>
+   <name>luser</name>
+  </author>
+  <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <ul class="filelist"><li class="file">testfile</li></ul>
+    </div>
+  </content>
+ </entry></feed>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/testdata/test-repo-tipsonly-data.xml
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+ <id>http://shiny-thing.local:8000/pushlog</id>
+ <link rel="self" href="http://shiny-thing.local:8000/pushlog" />
+ <updated>2008-11-20T15:53:42Z</updated>
+ <title>hg-test Pushlog</title>
+ <entry>
+  <title>Changeset 427bfb5defee1bbe75f3fcd8a86be3ad33657e95</title>
+  <id>http://www.selenic.com/mercurial/#changeset-427bfb5defee1bbe75f3fcd8a86be3ad33657e95</id>
+  <link href="http://shiny-thing.local:8000/rev/427bfb5defee1bbe75f3fcd8a86be3ad33657e95" />
+  <updated>2008-11-20T15:53:42Z</updated>
+  <author>
+   <name>luser</name>
+  </author>
+  <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <ul class="filelist"><li class="file">testfile</li></ul>
+    </div>
+  </content>
+ </entry>
+ <entry>
+  <title>Changeset 5995073215aee645700749a66989b1936b5f4ca6</title>
+  <id>http://www.selenic.com/mercurial/#changeset-5995073215aee645700749a66989b1936b5f4ca6</id>
+  <link href="http://shiny-thing.local:8000/rev/5995073215aee645700749a66989b1936b5f4ca6" />
+  <updated>2008-11-20T15:53:37Z</updated>
+  <author>
+   <name>luser</name>
+  </author>
+  <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <ul class="filelist"><li class="file">testfile</li></ul>
+    </div>
+  </content>
+ </entry>
+ <entry>
+  <title>Changeset a79451771352e444711b99134174c5daa05db9cd</title>
+  <id>http://www.selenic.com/mercurial/#changeset-a79451771352e444711b99134174c5daa05db9cd</id>
+  <link href="http://shiny-thing.local:8000/rev/a79451771352e444711b99134174c5daa05db9cd" />
+  <updated>2008-11-20T15:53:32Z</updated>
+  <author>
+   <name>luser</name>
+  </author>
+  <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <ul class="filelist"><li class="file">testfile</li></ul>
+    </div>
+  </content>
+ </entry>
+ <entry>
+  <title>Changeset 0ea9c66e27948fde116fbaa141bb53e9f7c23359</title>
+  <id>http://www.selenic.com/mercurial/#changeset-0ea9c66e27948fde116fbaa141bb53e9f7c23359</id>
+  <link href="http://shiny-thing.local:8000/rev/0ea9c66e27948fde116fbaa141bb53e9f7c23359" />
+  <updated>2008-11-20T15:53:26Z</updated>
+  <author>
+   <name>luser</name>
+  </author>
+  <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <ul class="filelist"><li class="file">testfile</li></ul>
+    </div>
+  </content>
+ </entry>
+ <entry>
+  <title>Changeset 6437207053fb9701290b738d720044803436ba3e</title>
+  <id>http://www.selenic.com/mercurial/#changeset-6437207053fb9701290b738d720044803436ba3e</id>
+  <link href="http://shiny-thing.local:8000/rev/6437207053fb9701290b738d720044803436ba3e" />
+  <updated>2008-11-20T15:53:21Z</updated>
+  <author>
+   <name>luser</name>
+  </author>
+  <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <ul class="filelist"><li class="file">testfile</li></ul>
+    </div>
+  </content>
+ </entry>
+ <entry>
+  <title>Changeset 25f2a69ac7ac2919ef35c0b937b862fbb9e7e1f7</title>
+  <id>http://www.selenic.com/mercurial/#changeset-25f2a69ac7ac2919ef35c0b937b862fbb9e7e1f7</id>
+  <link href="http://shiny-thing.local:8000/rev/25f2a69ac7ac2919ef35c0b937b862fbb9e7e1f7" />
+  <updated>2008-11-20T15:53:16Z</updated>
+  <author>
+   <name>luser</name>
+  </author>
+  <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <ul class="filelist"><li class="file">testfile</li></ul>
+    </div>
+  </content>
+ </entry>
+ <entry>
+  <title>Changeset af5fb85d93246318a4050c4def448cbcfd068e57</title>
+  <id>http://www.selenic.com/mercurial/#changeset-af5fb85d93246318a4050c4def448cbcfd068e57</id>
+  <link href="http://shiny-thing.local:8000/rev/af5fb85d93246318a4050c4def448cbcfd068e57" />
+  <updated>2008-11-20T15:53:10Z</updated>
+  <author>
+   <name>luser</name>
+  </author>
+  <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <ul class="filelist"><li class="file">testfile</li></ul>
+    </div>
+  </content>
+ </entry>
+ <entry>
+  <title>Changeset 853ae4aff7ec183c47f8b9b08faff9f8f4083855</title>
+  <id>http://www.selenic.com/mercurial/#changeset-853ae4aff7ec183c47f8b9b08faff9f8f4083855</id>
+  <link href="http://shiny-thing.local:8000/rev/853ae4aff7ec183c47f8b9b08faff9f8f4083855" />
+  <updated>2008-11-20T15:53:05Z</updated>
+  <author>
+   <name>luser</name>
+  </author>
+  <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <ul class="filelist"><li class="file">testfile</li></ul>
+    </div>
+  </content>
+ </entry>
+ <entry>
+  <title>Changeset 4ccee53e18ac923ff9ac995805748167128327a9</title>
+  <id>http://www.selenic.com/mercurial/#changeset-4ccee53e18ac923ff9ac995805748167128327a9</id>
+  <link href="http://shiny-thing.local:8000/rev/4ccee53e18ac923ff9ac995805748167128327a9" />
+  <updated>2008-11-20T15:53:00Z</updated>
+  <author>
+   <name>luser</name>
+  </author>
+  <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <ul class="filelist"><li class="file">testfile</li></ul>
+    </div>
+  </content>
+ </entry>
+ <entry>
+  <title>Changeset 7886a3f7fcba196c29bd9de0cc4d858cdc4910b9</title>
+  <id>http://www.selenic.com/mercurial/#changeset-7886a3f7fcba196c29bd9de0cc4d858cdc4910b9</id>
+  <link href="http://shiny-thing.local:8000/rev/7886a3f7fcba196c29bd9de0cc4d858cdc4910b9" />
+  <updated>2008-11-20T15:52:55Z</updated>
+  <author>
+   <name>luser</name>
+  </author>
+  <content type="xhtml">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <ul class="filelist"><li class="file">testfile</li></ul>
+    </div>
+  </content>
+ </entry></feed>
\ No newline at end of file