示例#1
0
def test_list_gateways(test_topic, capsys):
    gateway_id = device_id_template.format('RS256')
    manager.create_registry(service_account_json, project_id, cloud_region,
                            pubsub_topic, registry_id)

    # TODO: consider adding test for ES256
    manager.create_gateway(service_account_json, project_id, cloud_region,
                           registry_id, None, gateway_id, rsa_cert_path,
                           'RS256')

    manager.list_gateways(service_account_json, project_id, cloud_region,
                          registry_id)

    # Clean up
    manager.delete_device(service_account_json, project_id, cloud_region,
                          registry_id, gateway_id)
    manager.delete_registry(service_account_json, project_id, cloud_region,
                            registry_id)

    out, _ = capsys.readouterr()

    assert 'Gateway ID: {}'.format(gateway_id) in out
def test_list_gateways(test_topic, capsys):
    gateway_id = device_id_template.format('RS256')
    manager.create_registry(
            service_account_json, project_id, cloud_region, pubsub_topic,
            registry_id)

    # TODO: consider adding test for ES256
    manager.create_gateway(
            service_account_json, project_id, cloud_region, registry_id,
            None, gateway_id, rsa_cert_path, 'RS256')

    manager.list_gateways(
        service_account_json, project_id, cloud_region, registry_id)

    # Clean up
    manager.delete_device(
            service_account_json, project_id, cloud_region, registry_id,
            gateway_id)
    manager.delete_registry(
            service_account_json, project_id, cloud_region, registry_id)

    out, _ = capsys.readouterr()

    assert 'Gateway ID: {}'.format(gateway_id) in out