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


Python validity_matcher.is_valid函数代码示例

本文整理汇总了Python中tests.support.validity_matcher.is_valid函数的典型用法代码示例。如果您正苦于以下问题:Python is_valid函数的具体用法?Python is_valid怎么用?Python is_valid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: test_queries_with_will_formatted_starts_and_ends_are_allowed

 def test_queries_with_will_formatted_starts_and_ends_are_allowed(self):
     validation_result = validate_request_args({
         'period': 'week',
         'start_at': '2010-01-01T00:10:10+00:00',
         'end_at': '2010-01-07T00:10:10+00:00',
     })
     assert_that( validation_result, is_valid() )
开发者ID:NRCan,项目名称:backdrop,代码行数:7,代码来源:test_validation.py

示例2: test_queries_for_hour_period_spanning_less_than_seven_days_are_allowed

 def test_queries_for_hour_period_spanning_less_than_seven_days_are_allowed(self):
     validation_result = validate_request_args({
         'period': 'hour',
         'start_at': '2000-02-02T00:00:00+00:00',
         'end_at': '2000-02-08T00:00:00+00:00'
     }, False)
     assert_that(validation_result, is_valid())
开发者ID:NRCan,项目名称:backdrop,代码行数:7,代码来源:test_validation.py

示例3: test_queries_with_sort_by_and_period_and_group_by_are_allowed

 def test_queries_with_sort_by_and_period_and_group_by_are_allowed(self):
     validation_result = validate_request_args({
         "sort_by": "foo:ascending",
         "period": "week",
         "group_by": "foo"
     })
     assert_that( validation_result, is_valid() )
开发者ID:frabcus,项目名称:backdrop,代码行数:7,代码来源:test_validation.py

示例4: test_that_periodic_queries_are_allowed

 def test_that_periodic_queries_are_allowed(self):
     validation_result = validate_request_args({
         'period': 'day',
         'start_at': '2012-11-01T00:00:00Z',
         'end_at': '2012-12-01T00:00:00Z',
     })
     assert_that(validation_result, is_valid())
开发者ID:NRCan,项目名称:backdrop,代码行数:7,代码来源:test_validation_of_queries_accessing_raw_data.py

示例5: test_period_with_just_positive_duration

    def test_period_with_just_positive_duration(self):
        validation_result = validate_request_args({
            'period': 'day',
            'duration': '3',
        })

        assert_that(validation_result, is_valid())
开发者ID:NRCan,项目名称:backdrop,代码行数:7,代码来源:test_validation.py

示例6: test_queries_for_hour_period_with_dates_at_middle_of_day_are_allowed

 def test_queries_for_hour_period_with_dates_at_middle_of_day_are_allowed(self):
     validation_result = validate_request_args({
         'period': 'hour',
         'start_at': '2000-02-02T12:00:00+00:00',
         'end_at': '2000-02-19T13:00:00+00:00'
     }, False)
     assert_that(validation_result, is_valid())
开发者ID:NRCan,项目名称:backdrop,代码行数:7,代码来源:test_validation.py

示例7: test_queries_with_dates_at_beginning_of_day_are_allowed

 def test_queries_with_dates_at_beginning_of_day_are_allowed(self):
     validation_result = validate_request_args({
         'period': 'day',
         'start_at': '2000-02-02T00:00:00+00:00',
         'end_at': '2000-02-19T00:00:00+00:00'
     }, False)
     assert_that(validation_result, is_valid())
开发者ID:NRCan,项目名称:backdrop,代码行数:7,代码来源:test_validation.py

示例8: test_that_period_query_with_monday_limits_is_allowed

 def test_that_period_query_with_monday_limits_is_allowed(self):
     validation_result = validate_request_args({
         'period': 'week',
         'start_at': '2013-04-01T00:00:00Z',
         'end_at': '2013-04-08T00:00:00Z'
     })
     assert_that(validation_result, is_valid())
开发者ID:frabcus,项目名称:backdrop,代码行数:7,代码来源:test_validation_of_queries_accessing_raw_data.py

示例9: test_that_query_ending_on_midnight_is_allowed

 def test_that_query_ending_on_midnight_is_allowed(self):
     result = validate_request_args({
         'group_by': 'some_key',
         'start_at': '2013-01-24T00:00:00+00:00',
         'end_at': '2013-01-31T00:00:00+00:00'
     })
     assert_that(result, is_valid())
开发者ID:frabcus,项目名称:backdrop,代码行数:7,代码来源:test_validation_of_queries_accessing_raw_data.py

示例10: test_that_querying_for_more_than_7_days_of_data_is_allowed

 def test_that_querying_for_more_than_7_days_of_data_is_allowed(self):
     validation_result = validate_request_args({
         'period': 'week',
         'start_at': '2013-04-01T00:00:00Z',
         'end_at': '2013-04-15T00:00:00Z'
     })
     assert_that(validation_result, is_valid())
开发者ID:frabcus,项目名称:backdrop,代码行数:7,代码来源:test_validation_of_queries_accessing_raw_data.py

示例11: test_that_inclusive_queries

 def test_that_inclusive_queries(self):
     validation_result = validate_request_args({
         'inclusive': 'true',
         'start_at': '2012-12-01T00:00:00Z',
         'end_at': '2012-12-01T00:00:00Z',
     })
     assert_that(validation_result, is_valid())
开发者ID:NRCan,项目名称:backdrop,代码行数:7,代码来源:test_validation.py

示例12: test_that_queries_which_are_midnight_and_not_utc_are_allowed

    def test_that_queries_which_are_midnight_and_not_utc_are_allowed(self):
        validation_result = validate_request_args({
            'group_by': 'some_key',
            'start_at': '2013-04-01T04:30:00+04:30',
            'end_at': '2013-04-08T00:00:00+00:00'
        })

        assert_that(validation_result, is_valid())
开发者ID:frabcus,项目名称:backdrop,代码行数:8,代码来源:test_validation_of_queries_accessing_raw_data.py

示例13: test_that_grouping_by_month_with_dates_on_the_1st_is_allowed

    def test_that_grouping_by_month_with_dates_on_the_1st_is_allowed(self):
        validation_result = validate_request_args({
            "period": "month",
            "start_at": "2013-01-01T00:00:00Z",
            "end_at": "2014-01-01T00:00:00Z"
        })

        assert_that(validation_result, is_valid())
开发者ID:frabcus,项目名称:backdrop,代码行数:8,代码来源:test_validation_of_queries_accessing_raw_data.py

示例14: test_period_with_start_at_and_duration

    def test_period_with_start_at_and_duration(self):
        validation_result = validate_request_args({
            'period': 'day',
            'start_at': '2000-02-02T00:00:00+00:00',
            'duration': '3',
        })

        assert_that(validation_result, is_valid())
开发者ID:NRCan,项目名称:backdrop,代码行数:8,代码来源:test_validation.py

示例15: test_that_collect_queries_with_valid_methods_are_allowed

    def test_that_collect_queries_with_valid_methods_are_allowed(self):
        valid_collection_methods = ["sum", "count", "set", "mean"]

        for method in valid_collection_methods:
            validation_result = validate_request_args({
                'group_by': 'foo',
                'collect': 'field:{0}'.format(method),
            })

            assert_that(validation_result, is_valid())
开发者ID:NRCan,项目名称:backdrop,代码行数:10,代码来源:test_validation.py


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