def test_date_time_g02(self): """ date_time_g02 """ date_time = { "time_zone": "Taipei", "time_server": "59.124.196.83", "date": "2013/02/04", "time": "13:10:00" } self.maxDiff = None e = ml_w_date_time.set(None, date_time) self.assertTrue(e[0], e[1]) f = open(os.path.join("running", "date_time.txt"), "r") e = f.readlines() f.close() if "json" == ml_system.CFG_TYPE: self.assertEqual(e, ['{"date": "2013/02/04", "time_server": "59.124.196.83", "time_zone": "Taipei", "time": "13:10:00"}']) if "jcfg" == ml_system.CFG_TYPE: self.assertEqual(e, ['date_time {\n', ' time_zone Taipei\n', ' time_server 59.124.196.83\n', ' date 2013/02/04\n', ' time 13:10:00\n', '}\n'])
def run(self): e = ml_w_date_time.set(None, date_time, threading.RLock())