Ejemplo n.º 1
0
    def test_from_dict(self, memcache_delete_mock):
        """Ensure merging two non-acked doesn't ack."""
        from datetime import datetime
        from sosbeacon.school import School

        school_dict = {
            'name': 'ly hoang long',
        }

        school = School.from_dict(school_dict)

        self.assertEqual(school_dict['name'], school.name)

        self.assertFalse(memcache_delete_mock.call_count)
Ejemplo n.º 2
0
    def test_from_dict(self, memcache_delete_mock):
        """Ensure merging two non-acked doesn't ack."""
        from datetime import datetime
        from sosbeacon.school import School

        school_dict = {
            'name': 'ly hoang long',
            }

        school = School.from_dict(school_dict)

        self.assertEqual(school_dict['name'], school.name)

        self.assertFalse(memcache_delete_mock.call_count)
Ejemplo n.º 3
0
    def test_to_from_composition(self):
        """Ensure to_dict(from_dict(x)) returns a correctly setup object."""
        from datetime import datetime
        from sosbeacon.school import School

        school_dict = {
            'name': 'ly hoang long',
        }

        school = School.from_dict(school_dict)
        school.put()

        new_school = school.to_dict()

        self.assertEqual(school_dict, new_school)
Ejemplo n.º 4
0
    def test_to_from_composition(self):
        """Ensure to_dict(from_dict(x)) returns a correctly setup object."""
        from datetime import datetime
        from sosbeacon.school import School

        school_dict = {
            'name': 'ly hoang long',
            }

        school = School.from_dict(school_dict)
        school.put()

        new_school = school.to_dict()

        self.assertEqual(school_dict, new_school)