Added get network test

This commit is contained in:
James Belleau 2020-05-06 21:54:59 -05:00
commit 811ec3bd2a
3 changed files with 25 additions and 1 deletions

View file

@ -6,7 +6,7 @@ from boto3 import Session
from moto.core import BaseBackend, BaseModel
from .exceptions import BadRequestException
from .exceptions import BadRequestException, ResourceNotFoundException
from .utils import get_network_id, get_member_id
@ -164,6 +164,10 @@ class ManagedBlockchainBackend(BaseBackend):
return self.networks.values()
def get_network(self, network_id):
if network_id not in self.networks:
raise ResourceNotFoundException(
"CreateNetwork", "Network {0} not found".format(network_id)
)
return self.networks.get(network_id)