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


Python testifycompat.assert_equal函数代码示例

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


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


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