Here are the examples of the python api mock. taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

5 Source File : pool_manager_test.py , under Apache License 2.0 , by Yelp
			 
			     @pytest.fixture
def mock_resource_groups():
    return {
        f'sfr-{i}': mock.Mock(
            id=f'sfr-{i}',
            instance_ids=[f'i-{i}'],
            target_capacity=i * 2 + 1,
            fulfilled_capacity=i * 6,
            market_capacities={'market-1': i, 'market-2': i * 2, 'market-3': i * 3},
            is_stale=False,
            market_weight=mock.Mock(return_value=1.0),
            terminate_instances_by_id=mock.Mock(return_value=[]),
            spec=AWSResourceGroup,
            mark_stale=mock.Mock(side_effect=NotImplementedError),
        )
        for i in range(7)
    }
				 
			
0 Source File : binary_providers_test.py , under Apache License 2.0 , by google
			 
			       def test_call(self):
    """Tests calling the method."""
    self.mock.stat.return_value = mock.Mock(st_mode=0600)