From patchwork Fri Oct 18 20:53:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 1179698 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=konsulko.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46vz3j6SXPz9sNx for ; Sat, 19 Oct 2019 08:01:37 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id A149DC21E15; Fri, 18 Oct 2019 20:59:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 21049C21E26; Fri, 18 Oct 2019 20:54:28 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4BDC4C21BE5; Fri, 18 Oct 2019 20:54:17 +0000 (UTC) Received: from mail-yw1-f43.google.com (mail-yw1-f43.google.com [209.85.161.43]) by lists.denx.de (Postfix) with ESMTPS id 7D20EC21DEC for ; Fri, 18 Oct 2019 20:53:54 +0000 (UTC) Received: by mail-yw1-f43.google.com with SMTP id s6so2649301ywe.5 for ; Fri, 18 Oct 2019 13:53:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=c9Mx6nAjdvqr13E8YKta6o2ms72lHYdG0Scdwshr9Ck=; b=j4gSfupXxJFirO0z3AZMph4f3ZuG2ryipl8K9h0wtskoRDIAf8uy8ZMnUeadhOYRIi aCoT5KxGkVFDxxJhDe3DDtaGRCorxeQfGJ7ULdrslJlyelI5X95E2MvdMJWK4EToPO0c tZ3FxLVymQl/BY4MMBU7l/IsE+y84iDyXyDtVQSORbCM7LCChiuvUfXpWCfhMEkBLFiO ITisTN3zGhDr3s3CE8LbkhPD9hojx7r5Ar8cchwZP0uIvD7iU6jZ9gNQvIWHcn5jPBjt ocRhqM41fZyeHtszNHR9VGGnmlnhdKWzRwK5+1isBnPFtFVrUaXxl1YgUiOY4kZuL+y3 DJsw== X-Gm-Message-State: APjAAAUy4lzvoI8vESHeX0yDODN6A5GpMSw2TEe4/cmKXKOLzXYyzgNc sTN5oa8QvjzqYWQwgrQFqWeE86E= X-Google-Smtp-Source: APXvYqwNq8PKuQrdCPwI4Tp6bD/iXUKz4V8HmAx0zc4zG7pQ2NlZAFbOvAQco5iKCg/L/FxSxp92IQ== X-Received: by 2002:a0d:e24b:: with SMTP id l72mr8093240ywe.63.1571432033119; Fri, 18 Oct 2019 13:53:53 -0700 (PDT) Received: from bill-the-cat.local (cpe-65-184-142-8.ec.res.rr.com. [65.184.142.8]) by smtp.gmail.com with ESMTPSA id f194sm205508ywb.53.2019.10.18.13.53.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2019 13:53:52 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Date: Fri, 18 Oct 2019 16:53:34 -0400 Message-Id: <20191018205338.14879-7-trini@konsulko.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191018205338.14879-1-trini@konsulko.com> References: <20191018205338.14879-1-trini@konsulko.com> Cc: Heinrich Schuchardt , Stephen Warren Subject: [U-Boot] [PATCH 06/10] test/py: test_ut.py: Ensure we use bytes X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" In the case of some unit tests we are working with providing a fake flash device that we have written some text strings in to. In this case we want to tell Python to encode things to bytes for us. Signed-off-by: Tom Rini --- test/py/tests/test_ut.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/py/tests/test_ut.py b/test/py/tests/test_ut.py index 62037d2c4530..6c7b8dd2b30e 100644 --- a/test/py/tests/test_ut.py +++ b/test/py/tests/test_ut.py @@ -10,14 +10,14 @@ def test_ut_dm_init(u_boot_console): fn = u_boot_console.config.source_dir + '/testflash.bin' if not os.path.exists(fn): - data = 'this is a test' - data += '\x00' * ((4 * 1024 * 1024) - len(data)) + data = b'this is a test' + data += b'\x00' * ((4 * 1024 * 1024) - len(data)) with open(fn, 'wb') as fh: fh.write(data) fn = u_boot_console.config.source_dir + '/spi.bin' if not os.path.exists(fn): - data = '\x00' * (2 * 1024 * 1024) + data = b'\x00' * (2 * 1024 * 1024) with open(fn, 'wb') as fh: fh.write(data)