lorax/tests/cli/lib/toml-compare
Alexander Todorov ff7d7c2d49 Add new sanity tests for blueprints
- verify SemVer .patch number will be automatically updated when
  we push the blueprint a second time without changing version
- verify show displays the content in TOML format and it matches
  what is on disk. Because of that also start with empty packages
  and groups fields in the initial toml. If they are missing they
  will be added automatically by lorax-composer and this simplifies
  the test
- verify delete works

Related: rhbz#1698366
2019-05-07 19:19:27 +03:00

21 lines
520 B
Python
Executable File

#!/usr/bin/env python
"""
Will compare 2 blueprints for equality!
On RHEL7/Python 2 toml uses dictionaries and
blueprint show doesn't keep the order of the elements.
For master/Python3 this is not the case.
"""
import sys
import pytoml
if len(sys.argv) != 3:
print("USAGE: ", __file__, "<blueprint-one.toml> <blueprint-two.toml>")
sys.exit(1)
blueprint_one = pytoml.loads(open(sys.argv[1]).read())
blueprint_two = pytoml.loads(open(sys.argv[2]).read())
assert blueprint_one == blueprint_two