From f62a28c91308912e58e186b44a51ceb7420eaf44 Mon Sep 17 00:00:00 2001 From: Eric Fayolle Date: Wed, 11 Apr 2018 17:47:02 +0200 Subject: [PATCH] Ajout de cas tests atmo.... --- Atmo/README.txt | 5 ++++ Atmo/cata-v0.xml | 1 - Atmo/modele_atmo_test1.py | 14 ++++++++- Atmo/modele_atmo_test2.py | 27 +++++++++++++++++ Atmo/modele_atmo_test2.xsd | 59 +++++++++++++++++++++++++++++++++++++ Atmo/modele_atmo_test3.py | 27 +++++++++++++++++ Atmo/modele_atmo_test3.xsd | 60 ++++++++++++++++++++++++++++++++++++++ Atmo/modele_atmo_test4.py | 37 +++++++++++++++++++++++ Atmo/modele_atmo_test4.xsd | 57 ++++++++++++++++++++++++++++++++++++ 9 files changed, 285 insertions(+), 2 deletions(-) create mode 100644 Atmo/modele_atmo_test2.py create mode 100755 Atmo/modele_atmo_test2.xsd create mode 100644 Atmo/modele_atmo_test3.py create mode 100755 Atmo/modele_atmo_test3.xsd create mode 100644 Atmo/modele_atmo_test4.py create mode 100755 Atmo/modele_atmo_test4.xsd diff --git a/Atmo/README.txt b/Atmo/README.txt index d76a5105..8d99a232 100644 --- a/Atmo/README.txt +++ b/Atmo/README.txt @@ -1,4 +1,9 @@ pyxbgen -u modele_atmo.xsd -m atmo --write-for-customization +/local/PyXB-1.2.6/scripts/pyxbgen -u modele_atmo_test1.xsd -m atmo1 --write-for-customization +/local/PyXB-1.2.6/scripts/pyxbgen -u modele_atmo_test2.xsd -m atmo2 --write-for-customization +/local/PyXB-1.2.6/scripts/pyxbgen -u modele_atmo_test3.xsd -m atmo3 --write-for-customization +/local/PyXB-1.2.6/scripts/pyxbgen -u modele_atmo_test4.xsd -m atmo4 --write-for-customization + /local/PyXB-1.2.6/scripts/pyxbgen -u modele_atmo.xsd -m atmo --write-for-customization /local/PyXB-1.2.6/scripts/pyxbgen -u model_atmo_ext.xsd -m atmo_ext --write-for-customization diff --git a/Atmo/cata-v0.xml b/Atmo/cata-v0.xml index bf1f56f0..db5781c4 100755 --- a/Atmo/cata-v0.xml +++ b/Atmo/cata-v0.xml @@ -1,5 +1,4 @@ - diff --git a/Atmo/modele_atmo_test1.py b/Atmo/modele_atmo_test1.py index b4540d3c..15f7322c 100644 --- a/Atmo/modele_atmo_test1.py +++ b/Atmo/modele_atmo_test1.py @@ -1,4 +1,4 @@ -import raw.atmo_test1 as mdm +import raw.atmo1 as mdm my_Wind_Speed=mdm.T_Wind_Speed(0) my_Value=mdm.T_Value(0) @@ -12,3 +12,15 @@ my_Mesure1=mdm.T_Mesure1(my_Value1,my_Unit1) my_Wind=mdm.T_Wind(my_Wind_Speed1,my_Mesure1,my_B_enter_mesure) my_Atmos=mdm.Atmos(my_Wind) +xmls=my_Atmos.toxml() +xmls=my_Atmos.toDOM().toprettyxml() + +open('modele_atmo_test1.xml', 'w').write(xmls) + +# ou +# liste=[my_Value1,my_Unit1] +# my_Mesure1=mdm.T_Mesure1(*liste) + +# my_Wind=mdm.T_Wind(my_Wind_Speed1,my_Mesure1,my_B_enter_mesure) +# my_Atmos=mdm.Atmos(my_Wind) +# my_Atmos.toxml() diff --git a/Atmo/modele_atmo_test2.py b/Atmo/modele_atmo_test2.py new file mode 100644 index 00000000..79108459 --- /dev/null +++ b/Atmo/modele_atmo_test2.py @@ -0,0 +1,27 @@ +import raw.atmo2 as mdm + +my_Wind_Speed=mdm.T_Wind_Speed(0) +my_Value=mdm.T_Value(0) +my_Unit=mdm.T_Unit(0) +my_Mesure=mdm.T_Mesure(my_Value,my_Unit) +# my_B_enter_mesure=mdm.T_B_enter_mesure(my_Wind_Speed,my_Mesure) + +my_Wind_Speed1=mdm.T_Wind_Speed1(1) +my_Value1=mdm.T_Value1(1) +my_Unit1=mdm.T_Unit1(1) +my_Mesure1=mdm.T_Mesure1(my_Value1,my_Unit1) + +# my_Wind=mdm.T_Wind(my_Wind_Speed1,my_Mesure1) +# my_Wind.append(my_Wind_Speed) +# my_Wind.append(my_Mesure) +# ou +# my_Wind.extend([my_Wind_Speed,my_Mesure]) +# ou +my_Wind=mdm.T_Wind(my_Wind_Speed1,my_Mesure1,my_Wind_Speed,my_Mesure) + + +my_Atmos=mdm.Atmos(my_Wind) +xmls=my_Atmos.toxml() +xmls=my_Atmos.toDOM().toprettyxml() + +open('modele_atmo_test2.xml', 'w').write(xmls) diff --git a/Atmo/modele_atmo_test2.xsd b/Atmo/modele_atmo_test2.xsd new file mode 100755 index 00000000..eac7c63a --- /dev/null +++ b/Atmo/modele_atmo_test2.xsd @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Atmo/modele_atmo_test3.py b/Atmo/modele_atmo_test3.py new file mode 100644 index 00000000..ad37948b --- /dev/null +++ b/Atmo/modele_atmo_test3.py @@ -0,0 +1,27 @@ +import raw.atmo3 as mdm + +my_Wind_Speed=mdm.T_Wind_Speed(0) +my_Value=mdm.T_Value(0) +my_Unit=mdm.T_Unit(0) +my_Mesure=mdm.T_Mesure(my_Value,my_Unit) +#on peut instancier l'élément global directement +my_B_enter_mesure=mdm.B_enter_mesure(my_Wind_Speed,my_Mesure) +my_Wind_Speed1=mdm.T_Wind_Speed1(1) +my_Value1=mdm.T_Value1(1) +my_Unit1=mdm.T_Unit1(1) +my_Mesure1=mdm.T_Mesure1(my_Value1,my_Unit1) + +my_Wind=mdm.T_Wind(my_Wind_Speed1,my_Mesure1,my_B_enter_mesure) +my_Atmos=mdm.Atmos(my_Wind) +xmls=my_Atmos.toxml() +xmls=my_Atmos.toDOM().toprettyxml() + +open('modele_atmo_test3.xml', 'w').write(xmls) + +# ou +# liste=[my_Value1,my_Unit1] +# my_Mesure1=mdm.T_Mesure1(*liste) + +# my_Wind=mdm.T_Wind(my_Wind_Speed1,my_Mesure1,my_B_enter_mesure) +# my_Atmos=mdm.Atmos(my_Wind) +# my_Atmos.toxml() diff --git a/Atmo/modele_atmo_test3.xsd b/Atmo/modele_atmo_test3.xsd new file mode 100755 index 00000000..b79cdcf2 --- /dev/null +++ b/Atmo/modele_atmo_test3.xsd @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Atmo/modele_atmo_test4.py b/Atmo/modele_atmo_test4.py new file mode 100644 index 00000000..54b99be3 --- /dev/null +++ b/Atmo/modele_atmo_test4.py @@ -0,0 +1,37 @@ +import raw.atmo4 as mdm + +my_Wind_Speed=mdm.T_Wind_Speed(0) +my_Value=mdm.T_Value(0) +my_Unit=mdm.T_Unit(0) +my_Mesure=mdm.T_Mesure(my_Value,my_Unit) +# my_B_enter_mesure=mdm.T_B_enter_mesure(my_Wind_Speed,my_Mesure) + +my_Wind_Speed1=mdm.T_Wind_Speed1(1) +my_Value1=mdm.T_Value1(1) +my_Unit1=mdm.T_Unit1(1) +my_Mesure1=mdm.T_Mesure1(my_Value1,my_Unit1) + +# my_Wind=mdm.T_Wind(my_Wind_Speed1,my_Mesure1) +# my_Wind.append(my_Wind_Speed) +# my_Wind.append(my_Mesure) +# ou +# my_Wind.extend([my_Wind_Speed,my_Mesure]) +# ou +my_Wind=mdm.T_Wind(my_Wind_Speed1,my_Mesure1,my_Wind_Speed,my_Mesure) + + +my_Atmos=mdm.Atmos(my_Wind) +xmls=my_Atmos.toxml() +xmls=my_Atmos.toDOM().toprettyxml() + +open('modele_atmo_test4.xml', 'w').write(xmls) + +import pyxb +class T_Wind_Speed2 (pyxb.binding.datatypes.int): + + """An atomic simple type.""" + + _ExpandedName = pyxb.namespace.ExpandedName(mdm.Namespace, u'T_Wind_Speed2') + _XSDLocation = pyxb.utils.utility.Location('', 0, 0) + _Documentation = None +mdm.Namespace.addCategoryObject('typeBinding', u'T_Wind_Speed2', T_Wind_Speed2) diff --git a/Atmo/modele_atmo_test4.xsd b/Atmo/modele_atmo_test4.xsd new file mode 100755 index 00000000..87fa0e38 --- /dev/null +++ b/Atmo/modele_atmo_test4.xsd @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 2.39.2