当前位置: 首页>>代码示例>>Python>>正文


Python Customer.get_points_for方法代码示例

本文整理汇总了Python中models.Customer.get_points_for方法的典型用法代码示例。如果您正苦于以下问题:Python Customer.get_points_for方法的具体用法?Python Customer.get_points_for怎么用?Python Customer.get_points_for使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在models.Customer的用法示例。


在下文中一共展示了Customer.get_points_for方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_point_deletion

# 需要导入模块: from models import Customer [as 别名]
# 或者: from models.Customer import get_points_for [as 别名]
 def test_point_deletion(self):
     result = Customer.get_points_for('sudhirurl')
     start_count = len(result)
     first_point = result[0]
     Point.delete_point(first_point['key'], self.sudhir_gmail)
     new_result = Customer.get_points_for('sudhirurl')
     self.assertEqual(len(new_result), start_count - 1)
     self.assertFalse(self.find(new_result, first_point))
开发者ID:dlokesh,项目名称:mappr,代码行数:10,代码来源:point_model_tests.py

示例2: test_user_creation_and_editing

# 需要导入模块: from models import Customer [as 别名]
# 或者: from models.Customer import get_points_for [as 别名]
    def test_user_creation_and_editing(self):
        test_user = users.User('[email protected]')
        new = Customer.create(url='test', user=test_user)
        self.assertTrue(new)
        self.assertEqual(Customer.get_points_for('test').__len__(), 0)
        self.assertTrue(Point.create_point(new, dict(lat=63.345, lon= -4.23)))
        self.assertEqual(Customer.get_points_for('test').__len__(), 1)

        self.assertRaises(Exception, Customer.create, url='test', user=users.User('[email protected]'))
        self.assertRaises(Exception, Customer.create, url='TeSt', user=users.User('[email protected]'))
        self.assertRaises(Exception, Customer.create, url='new_test', user=test_user)

        renew = Customer.create(url='newtest', user=test_user)
        self.assertTrue(renew)
        self.assertEqual(Customer.get_points_for('newtest').__len__(), 1)
        self.assertTrue(Point.create_point(renew, dict(lat=43.345, lon= -3.23)))
        self.assertEqual(Customer.get_points_for('newtest').__len__(), 2)
开发者ID:dlokesh,项目名称:mappr,代码行数:19,代码来源:customer_model_tests.py

示例3: test_point_editing

# 需要导入模块: from models import Customer [as 别名]
# 或者: from models.Customer import get_points_for [as 别名]
    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)
开发者ID:dlokesh,项目名称:mappr,代码行数:19,代码来源:point_model_tests.py

示例4: test_setting_points_for_user

# 需要导入模块: from models import Customer [as 别名]
# 或者: from models.Customer import get_points_for [as 别名]
 def test_setting_points_for_user(self):
     mom = models.Customer(user=users.User('[email protected]'), url='momurl')
     mom.put()
     confirmation = Point.create_point(mom, dict(lat=34.678, lon= -44.3456))
     self.assertTrue(confirmation)
     result = Customer.get_points_for('momurl')
     self.assertEqual(len(result), 1)
     self.assertEqual(result.count(dict(lat=34.678, lon= -44.3456, title='Untitled', key=str(confirmation.key()))), 1) 
开发者ID:dlokesh,项目名称:mappr,代码行数:10,代码来源:point_model_tests.py

示例5: test_getting_points_for_user

# 需要导入模块: from models import Customer [as 别名]
# 或者: from models.Customer import get_points_for [as 别名]
    def test_getting_points_for_user(self):
        valid_result = Customer.get_points_for('sudhirurl')
        self.assertEqual(len(valid_result), 2)

        valid_result = Customer.get_points_for('suDhirurl')
        self.assertEqual(len(valid_result), 2)

        valid_result = Customer.get_points_for('sudhirURl')
        self.assertEqual(len(valid_result), 2)

        non_existent_url = Customer.get_points_for('somerubbish')
        self.assertEqual(non_existent_url, None)

        new_guy = models.Customer(user=users.User('[email protected]'), url='someguyurl')
        new_guy.put()
        empty_result = Customer.get_points_for('someguyurl')
        self.assertEqual(empty_result, [])
        empty_result = Customer.get_points_for('SomEguyurl')
        self.assertEqual(empty_result, [])
开发者ID:dlokesh,项目名称:mappr,代码行数:21,代码来源:customer_model_tests.py

示例6: get_points_for

# 需要导入模块: from models import Customer [as 别名]
# 或者: from models.Customer import get_points_for [as 别名]
def get_points_for(url):
    return Customer.get_points_for(url)
开发者ID:dlokesh,项目名称:mappr,代码行数:4,代码来源:gateway.py


注:本文中的models.Customer.get_points_for方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。