'Test the \'max_count\' property of LibraryContent blocks.'

@ddt.data((2, 1, 1), (2, 2, 2), (2, 20, 2))
@ddt.unpack
def test_max_items(self, num_to_create, num_to_select, num_expected):

    for _ in range(num_to_create):
        self._add_simple_content_block()
    with modulestore().default_store(ModuleStoreEnum.Type.split):
        course = CourseFactory.create()
    lc_block = self._add_library_content_block(course, self.lib_key, other_settings={'max_count': num_to_select})
    self.assertEqual(len(lc_block.children), 0)
    lc_block = self._refresh_children(lc_block)
    self._bind_module(lc_block)
    self.assertEqual(len(lc_block.children), num_to_create)
    self.assertEqual(len(lc_block.get_child_descriptors()), num_expected)
