示例#1
0
def test_chattr_has_extended_attrs_should_return_False_if_chattr_version_is_None():
    patch_chattr = patch(
        "salt.modules.file._chattr_version",
        Mock(return_value=None),
    )
    with patch_chattr:
        actual = filemod._chattr_has_extended_attrs()
        assert not actual, actual
示例#2
0
def test_chattr_has_extended_attrs_should_return_False_if_version_is_too_low():
    below_expected = "0.1.1"
    patch_chattr = patch(
        "salt.modules.file._chattr_version",
        Mock(return_value=below_expected),
    )
    with patch_chattr:
        actual = filemod._chattr_has_extended_attrs()
        assert not actual, actual
示例#3
0
def test_chattr_has_extended_attrs_should_return_True_if_version_is_above_threshold():
    higher_than = "1.41.13"
    patch_chattr = patch(
        "salt.modules.file._chattr_version",
        Mock(return_value=higher_than),
    )
    with patch_chattr:
        actual = filemod._chattr_has_extended_attrs()
        assert actual, actual
示例#4
0
def test_chattr_has_extended_attrs_should_return_False_if_version_is_equal_threshold():
    threshold = "1.41.12"
    patch_chattr = patch(
        "salt.modules.file._chattr_version",
        Mock(return_value=threshold),
    )
    with patch_chattr:
        actual = filemod._chattr_has_extended_attrs()
        assert not actual, actual