@mark_requirement(Requirements.DATUM_GENERAL_REQ)
def test_probe_text_file_success(self):
    with open(osp.join(self._dataset_root, 'foobar.txt'), 'w') as f:
        print('123', file=f)

    def detect(context):
        with context.probe_text_file('foobar.txt', 'abcde') as f:
            if (next(f) != '123\n'):
                raise Exception
    result = apply_format_detector(self._dataset_root, detect)
    self.assertEqual(result, FormatDetectionConfidence.MEDIUM)
@mark_requirement(Requirements.DATUM_GENERAL_REQ)
def test_probe_text_file_success(self):
    with open(osp.join(self._dataset_root, 'foobar.txt'), 'w') as f:
        print('123', file=f)

    def detect(context):
        with context.probe_text_file('foobar.txt', 'abcde') as f:
            if (next(f) != '123\n'):
                raise Exception
    result = apply_format_detector(self._dataset_root, detect)
    self.assertEqual(result, FormatDetectionConfidence.MEDIUM)