'Make sure that path_to_location works'

@ddt.data((ModuleStoreEnum.Type.mongo, [12, 3], 0), (ModuleStoreEnum.Type.split, [2, 2], 0))
@ddt.unpack
def test_path_to_location(self, default_ms, num_finds, num_sends):

    self.initdb(default_ms)
    course_key = self.course_locations[self.MONGO_COURSEID].course_key
    with self.store.branch_setting(ModuleStoreEnum.Branch.published_only, course_key):
        self._create_block_hierarchy()
        should_work = ((self.problem_x1a_2, (course_key, u'Chapter_x', u'Sequential_x1', u'Vertical_x1a', '1', self.problem_x1a_2)), (self.chapter_x, (course_key, 'Chapter_x', None, None, None, self.chapter_x)))
        for (location, expected) in should_work:
            with check_mongo_calls(num_finds.pop(0), num_sends):
                path = path_to_location(self.store, location)
                self.assertEqual(path, expected)
    not_found = (course_key.make_usage_key('video', 'WelcomeX'), course_key.make_usage_key('course', 'NotHome'))
    for location in not_found:
        with self.assertRaises(ItemNotFoundError):
            path_to_location(self.store, location)
    orphan = course_key.make_usage_key('chapter', 'OrphanChapter')
    self.store.create_item(self.user_id, orphan.course_key, orphan.block_type, block_id=orphan.block_id)
    with self.assertRaises(NoPathToItem):
        path_to_location(self.store, orphan)
