'Test create_folder when the datacenter vmFolder is empty'

def test_create_folder_with_empty_vmfolder(self):

    child_folder = mock.sentinel.child_folder
    session = fake.FakeSession()
    with mock.patch.object(session, '_call_method', side_effect=[None, child_folder]):
        parent_folder = mock.sentinel.parent_folder
        parent_folder.value = 'parent-ref'
        child_name = 'child_folder'
        ret = vm_util.create_folder(session, parent_folder, child_name)
        self.assertEqual(child_folder, ret)
        expected_calls = [mock.call(vutil, 'get_object_property', parent_folder, 'childEntity'), mock.call(session.vim, 'CreateFolder', parent_folder, name=child_name)]
        self.assertEqual(expected_calls, session._call_method.call_args_list)
