def test_check_readable__fake_file_raises(self): """Should raise an error if the file isn't readable.""" fake_file = os.path.join(os.path.dirname(XFORM_SPEC_PATH), ".fake") with self.assertRaises(IOError): check_readable(file_path=fake_file, retry_limit=2, wait_seconds=0.1)
def install_ok(bin_file_path=ODK_VALIDATE_PATH): """ Check if ODK Validate functions as expected. """ check_readable(file_path=XFORM_SPEC_PATH) return_code, _, _, _ = _call_validator(path_to_xform=XFORM_SPEC_PATH, bin_file_path=bin_file_path) if return_code == 1: return False return True
def test_check_readable__real_file_ok(self): """Should return True if the file is readable.""" self.assertTrue(check_readable(file_path=XFORM_SPEC_PATH))