Пример #1
0
    def test_show(self, get_instances_mock, refresh_mock):
        _subnet = Subnet(id='subnet-id', vpc_id='vpc-id', metadata=None)
        _subnet.instances = None

        result = _subnet.show()

        self.assertEqual(result, {
            'VpcId': 'vpc-id',
            'SubnetId': 'subnet-id',
            'Instances': None
        })

        get_instances_mock.assert_called_once_with(refresh=True, role=None)
        refresh_mock.assert_called_once()
Пример #2
0
    def test_show(self, ConnectionMock, get_instances_mock, refresh_mock):
        conn_mock = ConnectionMock()
        Subnet.ec2_conn = Subnet.route53_conn = conn_mock

        _subnet = Subnet(id='subnet-id', vpc_id='vpc-id', metadata=None)
        _subnet.instances = None

        result = _subnet.show()

        self.assertEqual(result, {
            'VpcId': 'vpc-id',
            'SubnetId': 'subnet-id',
            'Instances': None
        })

        get_instances_mock.assert_called_once_with(refresh=True, role=None)
        refresh_mock.assert_called_once()