Fix diskfile test failing on macOS

The existing test fails on macOS because the value of errno.ENODATA is
platform dependent. On macOS ENODATA is 96:

% man 2 intro|grep ENODATA
     96 ENODATA No message available.

Change-Id: Ibc760e641d4351ed771f2321dba27dc4e5b367c1
This commit is contained in:
Alistair Coles 2024-02-26 11:12:47 +00:00
parent 50336c5098
commit 2da150b890

View File

@ -4893,8 +4893,8 @@ class DiskFileMixin(BaseDiskFileTestMixin):
with self.assertRaises(DiskFileQuarantined) as err: with self.assertRaises(DiskFileQuarantined) as err:
df.open() df.open()
self.assertEqual( self.assertEqual(
'Failed to open %s: [Errno 61] -ENODATA fool!' % df._data_file, 'Failed to open %s: [Errno %d] -ENODATA fool!'
str(err.exception)) % (df._data_file, errno.ENODATA), str(err.exception))
def test_quarantine_hashdir_not_a_directory(self): def test_quarantine_hashdir_not_a_directory(self):
df, df_data = self._create_test_file(b'1234567890', account="abc", df, df_data = self._create_test_file(b'1234567890', account="abc",