def test_unreadable_directory(self): os.mkdir(self.full_path) with mock.patch('os.listdir') as mock_class: mock_class.side_effect = OSError() self.assertFalse(is_readable(self.full_path))
def test_unreadable_file(self): self.files.create_file(self.filename, contents="foo") open_function = 'awscli.customizations.s3.filegenerator._open' with mock.patch(open_function) as mock_class: mock_class.side_effect = OSError() self.assertFalse(is_readable(self.full_path))