예제 #1
0
 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)
예제 #2
0
파일: __init__.py 프로젝트: qlands/pyxform
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
예제 #3
0
 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))