From 367c0455129ae2b496858884b2432bb5d6ec2e48 Mon Sep 17 00:00:00 2001 From: Ricardo Martincoski Date: Fri, 16 Nov 2018 01:57:22 -0200 Subject: support/testing: add python-attrs tests Use a minimal script to check the basic usage creating a class with 2 attributes. Signed-off-by: Ricardo Martincoski Signed-off-by: Thomas Petazzoni --- support/testing/tests/package/sample_python_attrs.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 support/testing/tests/package/sample_python_attrs.py (limited to 'support/testing/tests/package/sample_python_attrs.py') diff --git a/support/testing/tests/package/sample_python_attrs.py b/support/testing/tests/package/sample_python_attrs.py new file mode 100644 index 0000000000..f224944914 --- /dev/null +++ b/support/testing/tests/package/sample_python_attrs.py @@ -0,0 +1,15 @@ +import attr + + +@attr.s +class Obj(object): + x = attr.ib() + y = attr.ib(default=1) + + +obj1 = Obj(2) +assert(obj1.x == 2) +assert(obj1.y == 1) +obj2 = Obj(3, 4) +assert(obj2.x == 3) +assert(obj2.y == 4) -- cgit v1.2.3