Esempio n. 1
0
def test_azure_connect(mock_creds, mock_sub_client):
    AzCredentials = namedtuple("AzCredentials", ["legacy", "modern"])
    mock_sub_client.return_value = "Client"
    mock_creds.return_value = AzCredentials("cred", "cred")
    az = AzureData()
    az.connect()
    assert az.connected is True
Esempio n. 2
0
def test_azure_connect_exp():
    with pytest.raises(AttributeError):
        az = AzureData()
        az.connect()
def test_azure_connect(mock_sub_client, mock_creds):
    mock_sub_client.return_value = "Client"
    mock_creds.return_value = "Creds"
    az = AzureData()
    az.connect(client_id="XXX", tenant_id="XXX", secret="XXX")
    assert az.connected == True
Esempio n. 4
0
def test_azure_init():
    az = AzureData()
    assert type(az) == AzureData
def test_azure_connect_exp():
    with raises(MsticpyException):
        az = AzureData()
        az.connect()