test_functional.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:deb-python-ddt 作者: openstack 项目源码 文件源码
def test_load_yaml_without_yaml_support():
    """
    Test that YAML files are not loaded if YAML is not installed.
    """

    @ddt
    class NoYAMLInstalledTest(object):

        @file_data('test_data_dict.yaml')
        def test_file_data_yaml_dict(self, value):
            assert_true(has_three_elements(value))

    tests = filter(_is_test, NoYAMLInstalledTest.__dict__)

    obj = NoYAMLInstalledTest()
    for test in tests:
        method = getattr(obj, test)
        assert_raises(ValueError, method)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号