Repository: aurora Updated Branches: refs/heads/master b18dc4458 -> 4b9033982
Upgrade to pystachio 0.8.0 Testing Done: ./pants test.pytest --no-fast src/test/python:: Reviewed at https://reviews.apache.org/r/33317/ Project: http://git-wip-us.apache.org/repos/asf/aurora/repo Commit: http://git-wip-us.apache.org/repos/asf/aurora/commit/4b903398 Tree: http://git-wip-us.apache.org/repos/asf/aurora/tree/4b903398 Diff: http://git-wip-us.apache.org/repos/asf/aurora/diff/4b903398 Branch: refs/heads/master Commit: 4b9033982a9724c02e3093869b7d6d89a11e9d63 Parents: b18dc44 Author: Brian Wickman <[email protected]> Authored: Mon Apr 20 14:20:23 2015 -0700 Committer: Brian Wickman <[email protected]> Committed: Mon Apr 20 14:20:23 2015 -0700 ---------------------------------------------------------------------- 3rdparty/python/requirements.txt | 2 +- .../python/apache/aurora/config/test_base.py | 25 ++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/aurora/blob/4b903398/3rdparty/python/requirements.txt ---------------------------------------------------------------------- diff --git a/3rdparty/python/requirements.txt b/3rdparty/python/requirements.txt index c23f98c..1410daf 100644 --- a/3rdparty/python/requirements.txt +++ b/3rdparty/python/requirements.txt @@ -8,7 +8,7 @@ mox==0.5.3 pex==0.8.2 protobuf==2.6.1 psutil==2.1.3 -pystachio==0.7.4 +pystachio==0.8.0 requests==2.3.0 requests-kerberos==0.6.1 thrift==0.9.1 http://git-wip-us.apache.org/repos/asf/aurora/blob/4b903398/src/test/python/apache/aurora/config/test_base.py ---------------------------------------------------------------------- diff --git a/src/test/python/apache/aurora/config/test_base.py b/src/test/python/apache/aurora/config/test_base.py index 66480db..5a58dd0 100644 --- a/src/test/python/apache/aurora/config/test_base.py +++ b/src/test/python/apache/aurora/config/test_base.py @@ -13,6 +13,7 @@ # import pytest +from pystachio import Default, Float, String, Struct from twitter.common.contextutil import temporary_file from apache.aurora.config import AuroraConfig, PortResolver @@ -200,3 +201,27 @@ def test_static_port_aliasing(): assert make_config(announce, 'thrift', 'health').job().taskConfig.requestedPorts == set() assert make_config(announce, 'derp').ports() == set(['derp']) assert make_config(announce, 'derp').job().taskConfig.requestedPorts == set(['derp']) + + +def test_pystachio_schema_regression(): + class ChildOld(Struct): + interval = Default(Float, 1.0) # noqa + + class ChildNew(Struct): + interval = Default(Float, 1.0) # noqa + endpoint = Default(String, '/health') # noqa + + class ParentOld(Struct): + child = Default(ChildOld, ChildOld()) # noqa + + class ParentNew(Struct): + child = Default(ChildNew, ChildNew()) # noqa + + new_parent = ParentNew() + old_parent = ParentOld.json_loads(new_parent.json_dumps()) + assert old_parent.child().interval().get() == 1.0 + + old_parent = ParentOld() + new_parent = ParentNew.json_loads(old_parent.json_dumps()) + assert new_parent.child().interval().get() == 1.0 + assert new_parent.child().endpoint().get() == '/health'
