Пример #1
0
 def test_get_from_s3_repo_error(self, mocked_s3client):
     mocked_s3client.return_value.get_object.side_effect = ClientError(
         {'Error': {
             'Code': 'NoSuchBucket'
         }}, '')
     with self.assertRaises(repo.RepositoryError):
         repo._get_from_repo('s3', 'test', 'foo')
Пример #2
0
 def test_get_from_s3_repo_error(self, mocked_s3client):
     mocked_s3client.return_value.get_object.side_effect = ClientError(
         {"Error": {
             "Code": "NoSuchBucket"
         }}, "")
     with self.assertRaises(repo.RepositoryError):
         repo._get_from_repo("s3", "test", "foo")
Пример #3
0
 def test_get_from_s3_ok(self, mocked_s3client):
     repo._get_from_repo('s3', 'test', 'bar')
     mocked_s3client.return_value.get_object.assert_called()
Пример #4
0
 def test_get_from_s3_ok(self, mocked_s3client):
     repo._get_from_repo("s3", "test", "bar")
     mocked_s3client.return_value.get_object.assert_called()