Пример #1
0
def dome9():
    dome9 = Dome9('U53RN4M3', 'P455W0RD')
    return dome9
Пример #2
0
 def __init__(self, *args, **kwargs):
     self._dome9 = Dome9()
Пример #3
0
def test_setting_arg_credentials():
    d9 = Dome9('U53RN4M3', 'P455W0RD')
    assert d9.key == "U53RN4M3"
    assert d9.secret == "P455W0RD"
Пример #4
0
def test_setting_endpoint():
    d9 = Dome9('U53RN4M3',
               'P455W0RD',
               endpoint='http://localhost:8000',
               apiVersion='v12')
    assert d9.endpoint == "http://localhost:8000/v12/"
Пример #5
0
def test_wrong_credentials():
    os.environ['DOME9_ACCESS_KEY'] = ''
    os.environ['DOME9_SECRET_KEY'] = ''
    with pytest.raises(ValueError):
        d9 = Dome9()
Пример #6
0
def test_setting_both_credentials():
    os.environ['DOME9_ACCESS_KEY'] = 'InvalidUsername'
    os.environ['DOME9_SECRET_KEY'] = 'InvalidPassword'
    d9 = Dome9('U53RN4M3', 'P455W0RD')
    assert d9.key == "U53RN4M3"
    assert d9.secret == "P455W0RD"
Пример #7
0
def test_setting_env_credentials():
    os.environ['DOME9_ACCESS_KEY'] = 'U53RN4M3'
    os.environ['DOME9_SECRET_KEY'] = 'P455W0RD'
    d9 = Dome9()
    assert d9.key == "U53RN4M3"
    assert d9.secret == "P455W0RD"