Questions tagged [moto]

Moto is a Python library that allows you to easily mock out tests based on AWS infrastructure and the Boto library (an AWS SDK for python).

Moto is a Python library that allows you to easily mock out tests based on AWS infrastructure and the Boto library (an AWS SDK for python).

Related tags:

Links:

193 questions
0
votes
1 answer

MOTO backend service how to create bucket

By any chance anyone can point me to correct direction? I'm trying to run the moto (https://github.com/spulec/moto) as backend service so that i can test out my application. I am able to run the moto service and load the webpage of the moto-api as…
jen1982
  • 67
  • 2
  • 11
0
votes
1 answer

Mocked moto rds DB instance is not reading from the EnableIAMDatabaseAuthentication parameter

I have this test that I'm trying to check for but it doesn't seem like EnableIAMDatabaseAuthentication is being passed to moto @mock_rds def test_iam_database_authentication_enabled(self): print(self.client.create_db_instance( …
Stupid.Fat.Cat
  • 10,755
  • 23
  • 83
  • 144
0
votes
1 answer

moto not mocking ec2.describe_security_groups function call

import boto3 .... @mock_ec2 def test_mocking_getting_security_groups(self): region = 'us-east-2' vpc_security_group_id = 'default' session = boto3.Session(profile_name=profile) ec2_client = session.client('ec2', region) …
Stupid.Fat.Cat
  • 10,755
  • 23
  • 83
  • 144
0
votes
1 answer

pylint fails with "unable to import moto", python can import it

I'm trying to pylint my testsuite that uses moto module for AWS API mockup. This is my super simple testcase: import moto Unfortunately it fails pylint: ~/prj $ pylint test_moto.py ************* Module test_test test_moto.py:1:0: E0401: Unable to…
MLu
  • 1,218
  • 2
  • 15
  • 28
0
votes
1 answer

moto mock_lambda get_function not working

Im trying to call the get_function method using moto mock lambda, and im getting UnrecognizedClientException as result, which means the mock is not working. The following is the code im using. Note that the call to create_function does work…
0
votes
1 answer

moto_server s3 slows down as tests progress

I have a test suite of ~1000 tests. Previously we were using the mock_s3 decorator which only worked because our "integration tests" just imported modules from other services and mocked their functionality. This was always been undesirable but has…
gmoss
  • 1,019
  • 5
  • 17
0
votes
1 answer

Running coverage.py on project with moto causes jinja2 error

I am mocking AWS calls to s3 with the @mock_s3 decorator from moto and boto3. I am running tests with "coverage run" from my root directory. Whenever my tests involve any sort of command involving listing the contents of AWS S3, I am getting this…
jli24
  • 1
  • 2
0
votes
0 answers

using boto s3 with django test client to test a http redirect to an s3 presigned url

I'm trying to provide a redirect to an s3 presigned url generated via boto3, it looks like it should work but I want to write a testcase for it. I've checked with something similar to what's below. The test_redirect_to_presigned_url() fails with a…
monkut
  • 42,176
  • 24
  • 124
  • 155
0
votes
1 answer

HEVC not playing in Moto G4 Plus while streaming from server

I'm developing an android app, in which I want to play HEVC formatted MP4 video in android devices. The source MP4 video is uploaded to server and I'm using PHP to stream video from server to android devices. The video is playing in Moto E2, RedMi…
Nandha Kumar
  • 131
  • 3
  • 13
0
votes
1 answer

Boto3 & moto - Route53 error creating dns record set, it can't find the hosted zone

I am having some troubles with Boto3 and the moto library for mocking AWS. I am creating a hosted zone like this: @moto.mock_route53 def create_dns_zone(route53_client, vpc, name='test.'): hosted_zone = route53_client.create_hosted_zone( …
0
votes
1 answer

moto with boto3 - Cannot build mock ELB

I'm new to moto and aws so I'm trying to wrtie some simple tests cases for a simple ELB checker in aws. I have read the moto page here: https://github.com/spulec/moto and I am following the boto3 guide…
Justin S
  • 1,409
  • 4
  • 22
  • 38
-1
votes
1 answer

Autostart permission programmatically

I am working on an app where I need to ask user for the autostart permission and for that I am opening the Autostart permissions settings page for the user to turn on the permission for our app using following code for few Manufacturers: Intent…
Kunal
  • 412
  • 5
  • 21
-2
votes
1 answer

TypeError: list indices must be integers or slices, not str Pytest with Moto DynamoDB

I am new to Python and this error seems to be to a general one and I can't understand it the context of my case. I am trying to unit test a class that is used to connect to DynamoDB with Pytest. and Moto mocks. Test: @mock_dynamodb def…
Adelin
  • 18,144
  • 26
  • 115
  • 175
1 2 3
12
13