示例#1
0
def test_client_acceptance_from_snapshot_negative(monkeypatch):
    monkeypatch.setattr('processor.connector.snapshot_aws.config_value', mock_config_value)
    monkeypatch.setattr('processor.connector.snapshot_aws.get_documents', mock_aws_get_documents_wthout_client)
    monkeypatch.setattr('processor.connector.snapshot_aws.json_source', mock_db_json_source)
    monkeypatch.setattr('processor.connector.snapshot_aws.get_vault_data', mock_get_vault_data)
    monkeypatch.setattr('processor.connector.snapshot_aws.client', mock_client)
    monkeypatch.setattr('processor.connector.snapshot_aws.insert_one_document', mock_insert_one_document)
    monkeypatch.setattr('processor.connector.snapshot_aws.get_collection_size', mock_get_collection_size)
    from processor.connector.snapshot_aws import populate_aws_snapshot
    val = populate_aws_snapshot(snapshot, 'mycontainer1')
    assert val == {'8': False}
示例#2
0
def test_populate_aws_snapshot_with_mastersnapshot(monkeypatch):
    monkeypatch.setattr('processor.connector.snapshot_aws.config_value', mock_config_value)
    monkeypatch.setattr('processor.connector.snapshot_aws.get_documents', mock_aws_get_documents)
    monkeypatch.setattr('processor.connector.snapshot_aws.json_source', mock_db_json_source)
    monkeypatch.setattr('processor.connector.snapshot_aws.get_vault_data', mock_get_vault_data)
    monkeypatch.setattr('processor.connector.snapshot_aws.client', mock_client)
    monkeypatch.setattr('processor.connector.snapshot_aws.insert_one_document', mock_insert_one_document)
    monkeypatch.setattr('processor.connector.snapshot_aws.Session', MockSession)
    monkeypatch.setattr('processor.connector.snapshot_aws.get_collection_size', mock_get_collection_size)
    from processor.connector.snapshot_aws import populate_aws_snapshot
    val = populate_aws_snapshot(master_snapshot, 'mycontainer1')
    assert val != {}