예제 #1
0
    def test_point_editing(self):
        result = Customer.get_points_for('sudhirurl')
        start_count = len(result)
        new_point_dict = dict(lat=7.0, lon=7.0, title="seven")
        new_point_key = Point.create_point(self.sudhir, new_point_dict).key().__str__()
        result = Customer.get_points_for('sudhirurl')

        self.assertEqual(len(result), start_count + 1)
        self.assertTrue(self.find(result, new_point_dict))

        new_point_dict = dict(lon=7.0, lat=8.0, title='seveneight')
        Point.edit(new_point_key, new_point_dict, self.sudhir_gmail)
        new_results = Customer.get_points_for('sudhirurl')

        self.assertEqual(len(new_results), start_count + 1)
        self.assertTrue(self.find(new_results, new_point_dict))
        self.assertRaises(db.BadValueError, Point.edit, new_point_key, dict(lon=2345, lat=3, title='invalid values'), self.sudhir_gmail)
예제 #2
0
파일: gateway.py 프로젝트: dlokesh/mappr
def edit_point(key, new_point, user):
    return Point.edit(key, new_point, user)