summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornitromaster101 <nitromaster101@5914aa95-5b3a-0410-a3b5-7b719e7fe9b2>2009-06-29 18:48:42 +0000
committernitromaster101 <nitromaster101@5914aa95-5b3a-0410-a3b5-7b719e7fe9b2>2009-06-29 18:48:42 +0000
commitb803f39cbb0615a88ddc8d393c18b901d91652c1 (patch)
treecbead967804abf562ae2db099554ece81f6b69fa
parent1a00604fe68b763e00b4cec488c3ba7b0a6daa03 (diff)
added tests for trans and unsafe
git-svn-id: http://freebase-python.googlecode.com/svn/trunk@149 5914aa95-5b3a-0410-a3b5-7b719e7fe9b2
-rwxr-xr-xtest/test_all.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test_all.py b/test/test_all.py
index b3802f6..cfe83f8 100755
--- a/test/test_all.py
+++ b/test/test_all.py
@@ -169,6 +169,23 @@ class TestFreebase(unittest.TestCase):
r = freebase.mqlread({"id":kurt, "/common/topic/article":[{"id":None, "optional":True, "limit":1}]})
raw = freebase.raw(r["/common/topic/article"][0].id)
self.assertNotEqual(len(raw), 0)
+
+ # trans should also work
+ trans = freebase.trans(r["/common/topic/article"][0].id)
+ self.assertEqual(trans, raw)
+
+ def test_unsafe(self):
+ kurt = "/en/kurt_vonnegut"
+
+ self.assertRaises(MetawebError, lambda: freebase.unsafe(kurt))
+
+ r = freebase.mqlread({"id":kurt, "/common/topic/article":[{"id":None, "optional":True, "limit":1}]})
+ unsafe = freebase.unsafe(r["/common/topic/article"][0].id)
+ self.assertNotEqual(len(unsafe), 0)
+
+ # we need an example of getting unsafe data
+ # ...
+
def test_trans_image_thumb(self):
kurt = "/en/kurt_vonnegut"