@mark_requirement(Requirements.DATUM_GENERAL_REQ)
def test_require_file_success(self):
    with open(osp.join(self._dataset_root, 'foobar.txt'), 'w'):
        pass
    selected_file = None

    def detect(context):
        nonlocal selected_file
        selected_file = context.require_file('**/[fg]oo*.t?t')
    result = apply_format_detector(self._dataset_root, detect)
    self.assertEqual(result, FormatDetectionConfidence.MEDIUM)
    self.assertEqual(selected_file, 'foobar.txt')
@mark_requirement(Requirements.DATUM_GENERAL_REQ)
def test_require_file_success(self):
    with open(osp.join(self._dataset_root, 'foobar.txt'), 'w'):
        pass
    selected_file = None

    def detect(context):
        nonlocal selected_file
        selected_file = context.require_file('**/[fg]oo*.t?t')
    result = apply_format_detector(self._dataset_root, detect)
    self.assertEqual(result, FormatDetectionConfidence.MEDIUM)
    self.assertEqual(selected_file, 'foobar.txt')