From e80d6866dad16a338e547e29382249f79f53efee Mon Sep 17 00:00:00 2001 From: Bryce Sampson Date: Fri, 10 Jun 2016 11:50:42 -0700 Subject: [PATCH] added test for extends and attributes attribute for projection --- Packages/vcs/vcs/projection.py | 9 +++++++-- testing/vcs/CMakeLists.txt | 6 ++++-- testing/vcs/test_vcs_extends.py | 0 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 testing/vcs/test_vcs_extends.py diff --git a/Packages/vcs/vcs/projection.py b/Packages/vcs/vcs/projection.py index 6b19c5e62f..cabf461eb5 100644 --- a/Packages/vcs/vcs/projection.py +++ b/Packages/vcs/vcs/projection.py @@ -327,6 +327,12 @@ def list(self): print 'name =', self.name print 'type =', self.type # print 'parameters =',self.parameters + + for att in self.attributes: + print att, '=', getattr(self, att) + + @property + def attributes(self): p = [] if self._type in [3, 4]: p.append('smajor') @@ -455,8 +461,7 @@ def list(self): p.append('centerlatitude') p.append('falseeasting') p.append('falsenorthing') - for att in p: - print att, '=', getattr(self, att) + return p ########################################################################## # # diff --git a/testing/vcs/CMakeLists.txt b/testing/vcs/CMakeLists.txt index 99244cd556..86e8cc3ae7 100644 --- a/testing/vcs/CMakeLists.txt +++ b/testing/vcs/CMakeLists.txt @@ -29,8 +29,10 @@ foreach(lat_0 45 90) ${lat_0} ) endforeach() - - +cdat_add_test(test_vcs_extends + "${PYTHON_EXECUTABLE}" + ${cdat_SOURCE_DIR}/testing/vcs/test_vcs_extends.py +) cdat_add_test(test_vcs_create_get "${PYTHON_EXECUTABLE}" ${cdat_SOURCE_DIR}/testing/vcs/test_vcs_create_get.py diff --git a/testing/vcs/test_vcs_extends.py b/testing/vcs/test_vcs_extends.py new file mode 100644 index 0000000000..e69de29bb2