From 61fc4d2b4e45b2e802907419fc1f3105ae5aaad8 Mon Sep 17 00:00:00 2001 From: Lars Karlitski Date: Mon, 24 Jun 2019 19:04:16 +0200 Subject: [PATCH] test: Fix test_blueprint_sanity The new toml library, introduced with abe7df34f, outputs different whitespace from the old one. Fix the test expectation and strip() results from toml.dumps(), because it contains superfluous newlines at the end. --- src/pylorax/api/toml.py | 3 ++- tests/cli/test_blueprints_sanity.sh | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pylorax/api/toml.py b/src/pylorax/api/toml.py index cbe912ab..9af568a9 100644 --- a/src/pylorax/api/toml.py +++ b/src/pylorax/api/toml.py @@ -29,4 +29,5 @@ def loads(s): raise TomlError(e.msg, e.doc, e.pos) def dumps(o): - return toml.dumps(o, encoder=toml.TomlEncoder(dict)) + # strip the result, because `toml.dumps` adds a lot of newlines + return toml.dumps(o, encoder=toml.TomlEncoder(dict)).strip() diff --git a/tests/cli/test_blueprints_sanity.sh b/tests/cli/test_blueprints_sanity.sh index ff50bd0d..a6bef801 100755 --- a/tests/cli/test_blueprints_sanity.sh +++ b/tests/cli/test_blueprints_sanity.sh @@ -36,7 +36,6 @@ description = "Start building tests with beakerlib." version = "0.0.1" modules = [] groups = [] - [[packages]] name = "beakerlib" version = "*"