diff options
| author | nitromaster101 <nitromaster101@5914aa95-5b3a-0410-a3b5-7b719e7fe9b2> | 2009-06-29 18:48:42 +0000 |
|---|---|---|
| committer | nitromaster101 <nitromaster101@5914aa95-5b3a-0410-a3b5-7b719e7fe9b2> | 2009-06-29 18:48:42 +0000 |
| commit | b803f39cbb0615a88ddc8d393c18b901d91652c1 (patch) | |
| tree | cbead967804abf562ae2db099554ece81f6b69fa /test | |
| parent | 1a00604fe68b763e00b4cec488c3ba7b0a6daa03 (diff) | |
added tests for trans and unsafe
git-svn-id: http://freebase-python.googlecode.com/svn/trunk@149 5914aa95-5b3a-0410-a3b5-7b719e7fe9b2
Diffstat (limited to 'test')
| -rwxr-xr-x | test/test_all.py | 17 |
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" |
