From b803f39cbb0615a88ddc8d393c18b901d91652c1 Mon Sep 17 00:00:00 2001 From: nitromaster101 Date: Mon, 29 Jun 2009 18:48:42 +0000 Subject: added tests for trans and unsafe git-svn-id: http://freebase-python.googlecode.com/svn/trunk@149 5914aa95-5b3a-0410-a3b5-7b719e7fe9b2 --- test/test_all.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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" -- cgit v1.3.1