def test_start(): title = "Life's Worth" description = "Track your worth by the ideas you complete" difficulity = 10 idea = Idea(title, description, difficulity) idea.started = True assert type(idea.started) == type(time.time())
def loadJSON(cls, obj): """ load json data """ if "__type__" in obj and obj["__type__"] == "Person": try: person = Person(obj["name"]) if "ideas" in obj: for idea in obj["ideas"]: person.addIdea(Idea.loadJSON(idea)) return person except ValueError: print("JSON is invalid") except KeyError as e: print("Invalid key: %s" % e)