コード例 #1
0
 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))
コード例 #2
0
ファイル: test_filegenerator.py プロジェクト: emyphan/aws-cli
 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))
コード例 #3
0
 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))
コード例 #4
0
ファイル: test_filegenerator.py プロジェクト: emyphan/aws-cli
 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))