Python Moto secretsmanager模拟can';不要一次模拟多个秘密对象

Python Moto secretsmanager模拟can';不要一次模拟多个秘密对象,python,pytest,moto,Python,Pytest,Moto,我有一个方法要测试调用在多个机密对象上获取_secret: @pytest.fixture(scope="session") def client(): conn = boto3.client("secretsmanager", region_name="us-west-1") yield conn @mock_secretsmanager def test_get_secret_value(client):

我有一个方法要测试调用在多个机密对象上获取_secret:

@pytest.fixture(scope="session")
def client():
    conn = boto3.client("secretsmanager", region_name="us-west-1")
    yield conn


@mock_secretsmanager
def test_get_secret_value(client):
   client.create_secret(
       Name="one", SecretString="sdfsdf"
   )
   client.create_secret(
       Name="two", SecretString="werwewe"
   )
   # Function that gets value of 2 secrets- "one" and "two"
   # Only "two" will exist as the second call to create_secret() will override the first it seems
   mymodule.get_one_and_two("one","two")
我收到一个错误:
botocore.errorfactory.ResourceNotFoundException:调用GetSecretValue操作时发生错误(ResourceNotFoundException):机密管理器找不到指定的机密

我是不是用错了moto?如何创建我的函数可以访问的两个秘密

编辑
看来这个问题应该已经解决了。我似乎仍然有这个问题:

如果我只是在测试中使用
client.get\u secret\u value(SecretId=“one”)
(与“two”相同),它对我来说很好。你是如何在
get\u one\u和\u two
中获取秘密的?
get\u one\u和\u two()
只需调用
get\u secret\u值(SecretId=“one”)
get\u secret\u值(SecretId=“two”)
Hm,这很奇怪。。。如果你像我一样直接在测试中调用这些函数,你能检查一下是否得到相同的结果吗?您使用的是哪个版本的moto?如果我在测试中只使用
客户端。获取\u secret\u值(SecretId=“one”)
(与“two”相同),它对我来说效果很好。你是如何在
get\u one\u和\u two
中获取秘密的?
get\u one\u和\u two()
只需调用
get\u secret\u值(SecretId=“one”)
get\u secret\u值(SecretId=“two”)
Hm,这很奇怪。。。如果你像我一样直接在测试中调用这些函数,你能检查一下是否得到相同的结果吗?您使用的是什么版本的moto?