Пример #1
0
def test_properties_are_not_settable():
    security_client = SymmetricKeySecurityClient(
        fake_registration_id, fake_symmetric_key, fake_id_scope
    )
    with pytest.raises(AttributeError, match="can't set attribute"):
        security_client.registration_id = "MyNimbus2000"
        security_client.id_scope = "WhompingWillow"
Пример #2
0
def test_create_sas():
    security_client = SymmetricKeySecurityClient(
        fake_registration_id, fake_symmetric_key, fake_id_scope
    )
    sas_value = security_client.get_current_sas_token()
    assert key_name in sas_value
    assert fake_registration_id in sas_value
    assert fake_id_scope in sas_value
 def op(self, mocker):
     security_client = SymmetricKeySecurityClient(
         provisioning_host="hogwarts.com",
         registration_id="registered_remembrall",
         id_scope="weasley_wizard_wheezes",
         symmetric_key="Zm9vYmFy",
     )
     security_client.get_current_sas_token = mocker.MagicMock()
     return pipeline_ops_provisioning.SetSymmetricKeySecurityClientOperation(
         security_client=security_client, callback=mocker.MagicMock())
 def test_properties_are_not_settable_after_instantiation_security_client(
         self):
     security_client = SymmetricKeySecurityClient(fake_provisioning_host,
                                                  fake_registration_id,
                                                  fake_id_scope,
                                                  fake_symmetric_key)
     with pytest.raises(AttributeError, match="can't set attribute"):
         security_client.registration_id = "MyNimbus2000"
         security_client.id_scope = "WhompingWillow"
         security_client.provisioning_host = "hogwarts.com"
Пример #5
0
def create_symmetric_key_security_client():
    return SymmetricKeySecurityClient(
        provisioning_host=fake_provisioning_host,
        registration_id=fake_registration_id,
        id_scope=fake_id_scope,
        symmetric_key=fake_symmetric_key,
    )
 def test_properties_are_gettable_after_instantiation_security_client(self):
     security_client = SymmetricKeySecurityClient(fake_provisioning_host,
                                                  fake_registration_id,
                                                  fake_id_scope,
                                                  fake_symmetric_key)
     assert security_client.provisioning_host == fake_provisioning_host
     assert security_client.id_scope == fake_id_scope
     assert security_client.registration_id == fake_registration_id
def security_client():
    return SymmetricKeySecurityClient("fake_registration_id",
                                      "fake_symmetric_key", "fake_id_scope")
Пример #8
0
def test_properties_are_gettable_after_create_security_client():
    security_client = SymmetricKeySecurityClient(
        fake_registration_id, fake_symmetric_key, fake_id_scope
    )
    assert security_client.id_scope == fake_id_scope
    assert security_client.registration_id == fake_registration_id