Added basic setup.py files.
[jben2_gui.git] / jben / tests / dict_downloader.py
blob96abd148ceaf2f82e50152afa1ca28b3eaf94d2b
1 # -*- coding: utf-8 -*-
3 import unittest, time
4 import jben.dict_downloader as dd
7 class Test(unittest.TestCase):
9 def test_get_mirror_list_offline(self):
10 ml = dd.get_mirror_list(from_inet=False)
11 self.assertTrue(len(ml) > 0)
13 def test_get_mirror_list_online(self):
14 ml = dd.get_mirror_list(from_inet=True)
15 self.assertTrue(len(ml) > 0)
17 class TestINet(unittest.TestCase):
19 """Tests to be run sparingly since they rely on Internet servers."""
21 def test_download_dict(self):
22 fname = "kanjidic.gz"
23 dd.download_dict(fname)
24 # Maybe add checking for file existance afterwards?
25 # For now, if the function runs without raising an exception,
26 # it's good enough.
29 if __name__ == "__main__":
30 unittest.main()