From 0c9fbd67b05112e43fe86bd634b155bd07a8f9b2 Mon Sep 17 00:00:00 2001 From: nitromaster101 Date: Thu, 18 Jun 2009 00:40:17 +0000 Subject: added uri upload git-svn-id: http://freebase-python.googlecode.com/svn/trunk@96 5914aa95-5b3a-0410-a3b5-7b719e7fe9b2 --- test/test_all.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/test_all.py b/test/test_all.py index cf52eef..b07cb35 100755 --- a/test/test_all.py +++ b/test/test_all.py @@ -203,7 +203,8 @@ class TestFreebase(unittest.TestCase): self.assertNotEqual(len(r1), len(r2)) def test_touch(self): - pass + # this one's hard to test... let's just make sure it works. + freebase.touch() def test_geosearch(self): @@ -213,8 +214,20 @@ class TestFreebase(unittest.TestCase): r0 = freebase.geosearch(location="/en/california") self.assertNotEqual(len(r0), 0) + json = freebase.geosearch(location="/en/san_francisco", format="json") + kml = freebase.geosearch(location="/en/san_francisco", format="kml") + self.assertNotEqual(json, kml) + def test_uri_submit(self): + # test a pdf + r = freebase.sandbox.uri_submit("http://www.jcbl.or.jp/game/nec/necfest07/nec2007_data/HayashiMiyake.pdf", content_type="application/pdf") + self.assertEqual(r['/type/content/media_type'], 'application/pdf') + + # test an image + r = freebase.sandbox.uri_submit("http://datamob.org/media/detail_freebase.png") + self.assertEqual(r['/type/content/media_type'], 'image/png') + if __name__ == '__main__': -- cgit v1.3.1