• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python testifycompat.assert_equal函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: test_post_validation_success

 def test_post_validation_success(self):
     os.environ['SSH_AUTH_SOCK'] = 'something'
     config = config_parse.valid_ssh_options.validate(
         self.config,
         self.context,
     )
     assert_equal(config.agent, True)
开发者ID:pombredanne,项目名称:Tron,代码行数:7,代码来源:config_parse_test.py


示例2: test_perform_with_params

 def test_perform_with_params(self):
     assert_equal(self.proxy.perform('equals')(2), [False, True, False])
     sometimes = ['sometimes'] * 3
     assert_equal(
         self.proxy.perform('equals')(3, sometimes=True),
         sometimes,
     )
开发者ID:Yelp,项目名称:Tron,代码行数:7,代码来源:proxy_test.py


示例3: test_configure_from_dict

 def test_configure_from_dict(self):
     config_data = {
         'scribe_host': 'example.com',
         'scribe_port': '5555'
     }
     config.configure_from_dict(config_data)
     T.assert_equal(config.scribe_host, config_data['scribe_host'])
开发者ID:asottile,项目名称:yelp_clog,代码行数:7,代码来源:config_test.py


示例4: test_from_config

 def test_from_config(self):
     config = mock.Mock()
     runner_factory = actioncommand.SubprocessActionRunnerFactory.from_config(
         config,
     )
     assert_equal(runner_factory.status_path, config.remote_status_path)
     assert_equal(runner_factory.exec_path, config.remote_exec_path)
开发者ID:Yelp,项目名称:Tron,代码行数:7,代码来源:actioncommand_test.py


示例5: test_attributes

 def test_attributes(self):
     expected = make_named_tron_config(
         jobs={
             'test_job':
                 make_job(
                     name="test_job",
                     namespace='test_namespace',
                     schedule=ConfigIntervalScheduler(
                         timedelta=datetime.timedelta(0, 20),
                         jitter=None,
                     ),
                     expected_runtime=datetime.timedelta(1),
                 )
         }
     )
     test_config = validate_fragment(
         'test_namespace',
         dict(
             jobs=[
                 dict(
                     name="test_job",
                     namespace='test_namespace',
                     node="node0",
                     schedule="interval 20s",
                     actions=[dict(name="action", command="command")],
                     cleanup_action=dict(command="command"),
                 )
             ]
         )
     )
     assert_equal(test_config, expected)
开发者ID:pombredanne,项目名称:Tron,代码行数:31,代码来源:config_parse_test.py


示例6: test_from_config

 def test_from_config(self):
     name = 'the pool name'
     nodes = [create_mock_node(), create_mock_node()]
     config = mock.Mock(name=name)
     new_pool = node.NodePool.from_config(config, nodes)
     assert_equal(new_pool.name, config.name)
     assert_equal(new_pool.nodes, nodes)
开发者ID:Yelp,项目名称:Tron,代码行数:7,代码来源:node_test.py


示例7: test_wildcards

 def test_wildcards(self):
     cfg = parse_groc('every day')
     assert_equal(cfg.ordinals, None)
     assert_equal(cfg.monthdays, None)
     assert_equal(cfg.weekdays, None)
     assert_equal(cfg.months, None)
     assert_equal(cfg.timestr, '00:00')
开发者ID:pombredanne,项目名称:Tron,代码行数:7,代码来源:scheduler_test.py


示例8: test_get_url_from_identifier_job

 def test_get_url_from_identifier_job(self):
     identifier = get_object_type_from_identifier(
         self.index,
         'MASTER.namea',
     )
     assert_equal(identifier.url, '/api/jobs/MASTER.namea')
     assert_equal(identifier.type, TronObjectType.job)
开发者ID:Yelp,项目名称:Tron,代码行数:7,代码来源:client_test.py


示例9: test__getitem__last_success

    def test__getitem__last_success(self):
        item = self.context["last_success#day-1"]
        expected_date = self.last_success.run_time - datetime.timedelta(days=1)
        assert_equal(item, str(expected_date.day))

        item = self.context["last_success#shortdate"]
        assert_equal(item, "2012-03-14")
开发者ID:Yelp,项目名称:Tron,代码行数:7,代码来源:command_context_test.py


示例10: test_notify

 def test_notify(self):
     handler = mock.MagicMock()
     self.obs.attach(['a', 'b'], handler)
     self.obs.notify('a')
     assert_equal(len(handler.handler.mock_calls), 1)
     self.obs.notify('b')
     assert_equal(len(handler.handler.mock_calls), 2)
开发者ID:Yelp,项目名称:Tron,代码行数:7,代码来源:observer_test.py


示例11: test_attach

    def test_attach(self):
        def func():
            return 1

        self.obs.attach('a', func)
        assert_equal(len(self.obs._observers), 1)
        assert_equal(self.obs._observers['a'], [func])
开发者ID:Yelp,项目名称:Tron,代码行数:7,代码来源:observer_test.py


示例12: test_get_url_from_identifier_action_run

 def test_get_url_from_identifier_action_run(self):
     identifier = get_object_type_from_identifier(
         self.index,
         'MASTER.nameb.7.run',
     )
     assert_equal(identifier.url, '/api/jobs/MASTER.nameb/7/run')
     assert_equal(identifier.type, TronObjectType.action_run)
开发者ID:Yelp,项目名称:Tron,代码行数:7,代码来源:client_test.py


示例13: test_cancel_schedules_a_new_run

    def test_cancel_schedules_a_new_run(self):
        config = BASIC_CONFIG + dedent(
            """
            jobs:
                -   name: "a_job"
                    node: local
                    schedule: "daily 05:00:00"
                    actions:
                        -   name: "first_action"
                            command: "echo OK"
        """
        )
        self.start_with_config(config)
        job_name = 'MASTER.a_job'
        job_url = self.client.get_url(job_name)

        self.sandbox.tronctl('cancel', '%s.0' % job_name)

        def wait_on_cancel():
            return len(self.client.job(job_url)['runs']) == 2

        sandbox.wait_on_sandbox(wait_on_cancel)

        run_states = [run['state'] for run in self.client.job(job_url)['runs']]
        expected = [
            actionrun.ActionRun.SCHEDULED,
            actionrun.ActionRun.CANCELLED,
        ]
        assert_equal(run_states, expected)
开发者ID:pombredanne,项目名称:Tron,代码行数:29,代码来源:trond_test.py


示例14: test_read_raw_config

 def test_read_raw_config(self):
     name = 'name'
     path = os.path.join(self.temp_dir, name)
     manager.write(path, self.content)
     self.manifest.get_file_name.return_value = path
     config = self.manager.read_raw_config(name)
     assert_equal(config, yaml.dump(self.content))
开发者ID:Yelp,项目名称:Tron,代码行数:7,代码来源:manager_test.py


示例15: test_parse_no_month

 def test_parse_no_month(self):
     cfg = parse_groc('1st,2nd,3rd,10th day at 00:00')
     assert_equal(cfg.ordinals, None)
     assert_equal(cfg.monthdays, {1, 2, 3, 10})
     assert_equal(cfg.weekdays, None)
     assert_equal(cfg.months, None)
     assert_equal(cfg.timestr, '00:00')
开发者ID:pombredanne,项目名称:Tron,代码行数:7,代码来源:scheduler_test.py


示例16: test_next_day_weekdays

    def test_next_day_weekdays(self):
        time_spec = trontimespec.TimeSpecification(weekdays=[1, 5])
        gen = time_spec.next_day(14, 2012, 3)
        assert_equal(list(gen), [16, 19, 23, 26, 30])

        gen = time_spec.next_day(1, 2012, 3)
        assert_equal(list(gen), [2, 5, 9, 12, 16, 19, 23, 26, 30])
开发者ID:Yelp,项目名称:Tron,代码行数:7,代码来源:trontimespec_test.py


示例17: test_get_next_to_finish_none

    def test_get_next_to_finish_none(self):
        next_run = self.run_collection.get_next_to_finish(node="seven")
        assert_equal(next_run, None)

        self.job_runs[1].state = None
        next_run = self.run_collection.get_next_to_finish()
        assert_equal(next_run, None)
开发者ID:pombredanne,项目名称:Tron,代码行数:7,代码来源:jobrun_test.py


示例18: test_next_day_monthdays

    def test_next_day_monthdays(self):
        time_spec = trontimespec.TimeSpecification(monthdays=[5, 10, 15])
        gen = time_spec.next_day(14, 2012, 3)
        assert_equal(list(gen), [15])

        gen = time_spec.next_day(1, 2012, 3)
        assert_equal(list(gen), [5, 10, 15])
开发者ID:Yelp,项目名称:Tron,代码行数:7,代码来源:trontimespec_test.py


示例19: test_trond_restart_job_with_run_history

    def test_trond_restart_job_with_run_history(self):
        config = BASIC_CONFIG + textwrap.dedent(
            """
           jobs:
              - name: fast_job
                node: local
                schedule: constant
                actions:
                  - name: single_act
                    command: "sleep 20 && echo good"
        """
        )
        self.start_with_config(config)

        action_run_url = self.client.get_url('MASTER.fast_job.0.single_act')
        sandbox.wait_on_state(
            self.client.action_runs,
            action_run_url,
            actionrun.ActionRun.RUNNING,
        )

        self.restart_trond()

        assert_equal(
            self.client.job_runs(action_run_url)['state'],
            actionrun.ActionRun.UNKNOWN,
        )

        next_run_url = self.client.get_url('MASTER.fast_job.-1.single_act')
        sandbox.wait_on_state(
            self.client.action_runs,
            next_run_url,
            actionrun.ActionRun.RUNNING,
        )
开发者ID:pombredanne,项目名称:Tron,代码行数:34,代码来源:trond_test.py


示例20: test_repr

 def test_repr(self, mock_many):
     result = self.adapter.get_repr()
     assert_equal(result['name'], self.pool.get_name.return_value)
     mock_many.assert_called_with(
         adapter.NodeAdapter,
         self.pool.get_nodes.return_value,
     )
开发者ID:pombredanne,项目名称:Tron,代码行数:7,代码来源:adapter_test.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python testing._chain_decorators_on函数代码示例发布时间:2022-05-27
下一篇:
Python test_runner.TestRunner类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap