def test_validate_file_ownership_defaults(self, _validate_owner, _is_file): _is_file.return_value = True config = { 'files': { 'test': {} } } guide.validate_file_ownership(config) _validate_owner.assert_called_once_with('root', 'root', 'test', False)
def test_validate_file_ownership(self, _validate_owner, _is_file): _is_file.return_value = True config = { 'files': { 'test': { 'owner': 'test-user', 'group': 'test-group', } } } guide.validate_file_ownership(config) _validate_owner.assert_called_once_with('test-user', 'test-group', 'test', False)
def test_validate_file_ownership_glob(self, _validate_owner, _is_file, _glob): _glob.return_value = ['test'] _is_file.return_value = True config = { 'files': { '*': { 'owner': 'test-user', 'group': 'test-group', } } } guide.validate_file_ownership(config) _validate_owner.assert_called_once_with('test-user', 'test-group', 'test')