Exemplo n.º 1
0
    def test_story_has_days_since_last_updated(self):
        story = Story({
            "name":"Some Thigns",
            "owned_by":"George",
            "id":"2222222",
            "updated_at":"2012/09/20 14:10:53 UTC"})

        should_return = _days_since_last_updated(
                            _tracker_string_to_time(story.updated_at),
                            datetime.today())

        self.assertEqual(
                story.days_since_last_updated, 
                should_return)
Exemplo n.º 2
0
    def test_UserList_tojson(self):
        a_user = User("George")
        story_xml = ET.parse("data/story_2").getroot()
        story = Story(xml_to_dictonary(story_xml))
        a_user.updateWip(story)
        user_list = [a_user]

        self.assertEquals(
                    userlist_tojson(user_list),
                    json.dumps([{
                            "name": "George",
                            "current_stories": [{
                                "id": "22222222",
                                "name": "The Rest Of the Things",
                                "updated_at":"2012/09/20 14:10:53 UTC",
                                "days_since_updated":_days_since_last_updated(_tracker_string_to_time(story.updated_at), datetime.today())
                            }], 
                            "wip": 1
                    }], sort_keys=True))
Exemplo n.º 3
0
 def test_tracker_string_to_time(self):
     self.assertEqual(
             _tracker_string_to_time("2012/09/20 14:10:53 UTC"),
             datetime(2012, 9, 20, 14, 10, 53))