diff options
author | Damien George <damien.p.george@gmail.com> | 2015-04-04 22:05:30 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-04-04 22:05:30 +0100 |
commit | 9dd36404646f857c4f250537bac0d9a8ad041d25 (patch) | |
tree | c6509bcd3c7d5c2e67332110c582df2b5a5c669f /tests/basics/property.py | |
parent | 7e758b1cf878312cab5d9d2825b36e7235ea10a3 (diff) | |
download | micropython-9dd36404646f857c4f250537bac0d9a8ad041d25.tar.gz micropython-9dd36404646f857c4f250537bac0d9a8ad041d25.zip |
tests: Add missing tests for builtins, and many other things.
Diffstat (limited to 'tests/basics/property.py')
-rw-r--r-- | tests/basics/property.py | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/tests/basics/property.py b/tests/basics/property.py deleted file mode 100644 index 7f3c833ad3..0000000000 --- a/tests/basics/property.py +++ /dev/null @@ -1,54 +0,0 @@ -class A: - def __init__(self, x): - self._x = x - - @property - def x(self): - print("x get") - return self._x - -a = A(1) -print(a.x) - -try: - a.x = 2 -except AttributeError: - print("AttributeError") - -class B: - def __init__(self, x): - self._x = x - - def xget(self): - print("x get") - return self._x - - def xset(self, value): - print("x set") - self._x = value - - x = property(xget, xset) - -b = B(3) -print(b.x) -b.x = 4 -print(b.x) - -class C: - def __init__(self, x): - self._x = x - - @property - def x(self): - print("x get") - return self._x - - @x.setter - def x(self, value): - print("x set") - self._x = value - -c = C(5) -print(c.x) -c.x = 6 -print(c.x) |