[Python-modules-commits] [fparser] 03/05: WIP test_Fortran_2015.py

Alastair McKinstry mckinstry at moszumanska.debian.org
Fri Jul 28 10:45:43 UTC 2017


This is an automated email from the git hooks/post-receive script.

mckinstry pushed a commit to branch dev-f2015
in repository fparser.

commit 6240bb6bccef6dafb3f6a74304ac2f8365a7f36e
Author: Alastair McKinstry <mckinstry at debian.org>
Date:   Tue Jul 25 13:58:15 2017 +0100

    WIP test_Fortran_2015.py
---
 src/fparser/tests/test_Fortran2015.py | 106 ++++++++++++++++++++++++++++++++++
 1 file changed, 106 insertions(+)

diff --git a/src/fparser/tests/test_Fortran2015.py b/src/fparser/tests/test_Fortran2015.py
new file mode 100644
index 0000000..f38253a
--- /dev/null
+++ b/src/fparser/tests/test_Fortran2015.py
@@ -0,0 +1,106 @@
+# Modified work Copyright (c) 2017 Irish Centre for High-End Computing (ICHEC)
+# Original work Copyright (c) 1999-2008 Pearu Peterson
+
+# All rights reserved.
+
+# Modifications made as part of the fparser project are distributed
+# under the following license:
+
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+
+# 3. Neither the name of the copyright holder nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# --------------------------------------------------------------------
+
+# The original software (in the f2py project) was distributed under
+# the following license:
+
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+
+#   a. Redistributions of source code must retain the above copyright notice,
+#      this list of conditions and the following disclaimer.
+#   b. Redistributions in binary form must reproduce the above copyright
+#      notice, this list of conditions and the following disclaimer in the
+#      documentation and/or other materials provided with the distribution.
+#   c. Neither the name of the F2PY project nor the names of its
+#      contributors may be used to endorse or promote products derived from
+#      this software without specific prior written permission.
+
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+# DAMAGE.
+
+# Extensions in Fortran 2015
+
+from fparser.Fortran2015 import *
+from fparser.api import get_reader
+
+from nose.tools import assert_equal
+import pytest
+
+def assertRaises(exc, cls, s):
+    try:
+        cls(s)
+        raise AssertionError('Expected %s but got nothing' % exc)
+    except exc:
+        pass
+
+
+###############################################################################
+############################### SECTION  5 ####################################
+###############################################################################
+
+# TODO: TEAM_TYPE
+
+def test_Team_Number(): #R506
+
+    cls = Team_Number
+    a = cls('1')
+    assert isinstance(a,cls),`a`
+    assert_equal(str(a),'1')
+    assert_equal(repr(a),"%s('1', None)" % (cls.__name__))
+
+def test_Team_Type():
+    cls = Team_Type
+    a = cls('type(team_type) :: tm')
+    assert isinstance(a,cls),`a`
+    
+
+def test_Form_Team(): #R506
+    cls = Form_Team_Stmt
+    tm = Team_Number
+    tv = Team_Variable
+    a = cls('form team (tm, tv)')
+    

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/fparser.git



More information about the Python-modules-commits mailing list