def test_make_prune_flags_returns_flags_from_config_plus_default_prefix(): retention_config = OrderedDict( (('keep_daily', 1), ('keep_weekly', 2), ('keep_monthly', 3))) result = module._make_prune_flags(retention_config) assert tuple(result) == BASE_PRUNE_FLAGS + (('--prefix', '{hostname}-'), )
def test_make_prune_flags_accepts_prefix_with_placeholders(): retention_config = OrderedDict((('keep_daily', 1), ('prefix', 'Documents_{hostname}-{now}'))) result = module._make_prune_flags(retention_config) expected = (('--keep-daily', '1'), ('--prefix', 'Documents_{hostname}-{now}')) assert tuple(result) == expected
def test_make_prune_flags_treats_none_prefix_as_no_prefix(): retention_config = OrderedDict((('keep_daily', 1), ('prefix', None))) result = module._make_prune_flags(retention_config) expected = (('--keep-daily', '1'), ) assert tuple(result) == expected
def test_make_prune_flags_accepts_prefix_with_placeholders(): retention_config = OrderedDict((('keep_daily', 1), ('prefix', 'Documents_{hostname}-{now}'))) result = module._make_prune_flags(retention_config) expected = (('--keep-daily', '1'), ('--prefix', 'Documents_{hostname}-{now}')) assert tuple(result) == expected
def test_make_prune_flags_should_return_flags_from_config(): retention_config = OrderedDict( ( ('keep_daily', 1), ('keep_weekly', 2), ('keep_monthly', 3), ) ) result = module._make_prune_flags(retention_config) assert tuple(result) == BASE_PRUNE_FLAGS
def test_make_prune_flags_should_return_flags_from_config_plus_default_prefix(): retention_config = OrderedDict( ( ('keep_daily', 1), ('keep_weekly', 2), ('keep_monthly', 3), ) ) result = module._make_prune_flags(retention_config) assert tuple(result) == BASE_PRUNE_FLAGS + (('--prefix', '{hostname}-'),)