def ToJson(self): return json.dumps({ 'Name': self.Name, 'StateClassName': self.StateClassName, 'StartTime': Utils.TimeToString(self.StartTime), 'EndTime': Utils.TimeToString(self.EndTime), })
def test_SpecifyThatTimeCanBeConvertedToString(self): timeObject = datetime.time(6, 15) self.assertEqual(type(Utils.TimeToString(timeObject)), type('string')) self.assertEqual(Utils.TimeToString(timeObject), "06:15")