All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcus Hoffmann via buildroot <buildroot@buildroot.org>
To: buildroot@buildroot.org
Cc: Marcus Hoffmann <buildroot@bubu1.eu>
Subject: [Buildroot] [PATCH 2/4] support/testing: add new python-ruamel-yaml runtime test
Date: Wed,  7 Feb 2024 18:09:54 +0100	[thread overview]
Message-ID: <20240207170959.2672846-2-buildroot@bubu1.eu> (raw)
In-Reply-To: <20240207170959.2672846-1-buildroot@bubu1.eu>

Signed-off-by: Marcus Hoffmann <buildroot@bubu1.eu>
---
 .../package/sample_python_ruamel_yaml.py      | 27 +++++++++++++++++++
 .../tests/package/test_python_ruamel_yaml.py  | 12 +++++++++
 2 files changed, 39 insertions(+)
 create mode 100644 support/testing/tests/package/sample_python_ruamel_yaml.py
 create mode 100644 support/testing/tests/package/test_python_ruamel_yaml.py

diff --git a/support/testing/tests/package/sample_python_ruamel_yaml.py b/support/testing/tests/package/sample_python_ruamel_yaml.py
new file mode 100644
index 0000000000..5b3a079471
--- /dev/null
+++ b/support/testing/tests/package/sample_python_ruamel_yaml.py
@@ -0,0 +1,27 @@
+from ruamel.yaml import YAML
+
+yaml_text = """
+Rootkey:
+  - ListEntry
+AnotherRootKey: some-string
+
+ListRoot:
+  - float-value: '1.0'
+    int-value: 10234
+    NestedList:
+      - 1
+      - 2
+
+  - another-float: '1.1'
+    another-int: 1111
+
+OneMoreRootKey: 9.99
+"""
+
+# Tests the pure python based implementation
+yaml = YAML(typ='safe', pure=True)
+
+parsed = yaml.load(yaml_text)
+
+assert parsed['OneMoreRootKey'] == 9.99
+assert parsed['ListRoot'][1]['another-int'] == 1111
diff --git a/support/testing/tests/package/test_python_ruamel_yaml.py b/support/testing/tests/package/test_python_ruamel_yaml.py
new file mode 100644
index 0000000000..15062b4455
--- /dev/null
+++ b/support/testing/tests/package/test_python_ruamel_yaml.py
@@ -0,0 +1,12 @@
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonPy3RuamelYaml(TestPythonPackageBase):
+    __test__ = True
+    config = TestPythonPackageBase.config + \
+        """
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_RUAMEL_YAML=y
+        """
+    sample_scripts = ["tests/package/sample_python_ruamel_yaml.py"]
+    timeout = 40
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2024-02-07 17:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-07 17:09 [Buildroot] [PATCH 1/4] package/python-ruamel-yaml: fix comment in hash file Marcus Hoffmann via buildroot
2024-02-07 17:09 ` Marcus Hoffmann via buildroot [this message]
2024-07-12 13:06   ` [Buildroot] [PATCH 2/4] support/testing: add new python-ruamel-yaml runtime test Thomas Petazzoni via buildroot
2024-07-31 15:38   ` Peter Korsgaard
2024-02-07 17:09 ` [Buildroot] [PATCH 3/4] package/python-ruamel-yaml-clib: new package Marcus Hoffmann via buildroot
2024-07-12 13:23   ` Thomas Petazzoni via buildroot
2024-02-07 17:09 ` [Buildroot] [PATCH 4/4] package/python-ruamel-yaml: bump to version 0.18.5 Marcus Hoffmann via buildroot
2024-07-12 13:23   ` Thomas Petazzoni via buildroot
2024-07-12 13:05 ` [Buildroot] [PATCH 1/4] package/python-ruamel-yaml: fix comment in hash file Thomas Petazzoni via buildroot
2024-07-28 11:07 ` Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240207170959.2672846-2-buildroot@bubu1.eu \
    --to=buildroot@buildroot.org \
    --cc=buildroot@bubu1.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.