Skip to content

Commit

Permalink
feature #15: restructure the pytest folder
Browse files Browse the repository at this point in the history
  • Loading branch information
melodypapa committed Jun 29, 2024
1 parent 2f2d75f commit 103b339
Show file tree
Hide file tree
Showing 21 changed files with 47 additions and 47 deletions.
2 changes: 1 addition & 1 deletion conf/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
nav:
- Home: 'index.md'
- About: 'about.md'
site_name: PyARModel
site_name: py-armodel
docs_dir: ../docs
4 changes: 2 additions & 2 deletions src/armodel/cli/swc_list_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def main():
ap.add_argument("-v", "--verbose", required= False, help= "Print debug information", action= "store_true")
ap.add_argument("-f", "--format", required= False, help= "Specify the short or long name of Sw-C. [short|long]")
ap.add_argument("--filter", required= False, help = "Set the filter condition. [CompositionSwComponent]")
ap.add_argument("Input", help = "The path of AUTOSAR XML", nargs='+')
ap.add_argument("INPUT", help = "The path of AUTOSAR XML", nargs='+')

args = ap.parse_args()

Expand Down Expand Up @@ -49,7 +49,7 @@ def main():
logger.addHandler(stdout_handler)

try:
parser = InputFileParser(args.Input)
parser = InputFileParser(args.INPUT)
filenames = parser.parse()

document = AUTOSAR().getInstance()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
""" Test AR Package """
import pytest

from armodel.models.ar_package import AUTOSAR
from armodel.models.datatype import ApplicationPrimitiveDataType, ApplicationRecordDataType, DataTypeMappingSet, ImplementationDataType, SwBaseType
from armodel.models.general_structure import ARElement, ARObject, CollectableElement, Identifiable, MultilanguageReferrable, PackageableElement, Referrable
from armodel.models.m2_msr import CompuMethod
from armodel.models.port_interface import ClientServerInterface, DataInterface, PortInterface, SenderReceiverInterface
from armodel.models.sw_component import ApplicationSwComponentType, AtomicSwComponentType, CompositionSwComponentType, EcuAbstractionSwComponentType, ServiceSwComponentType, SwComponentType

from ....models.ar_package import AUTOSAR
from ....models.datatype import ApplicationPrimitiveDataType, ApplicationRecordDataType, DataTypeMappingSet, ImplementationDataType, SwBaseType
from ....models.general_structure import ARElement, ARObject, CollectableElement, Identifiable, MultilanguageReferrable, PackageableElement, Referrable
from ....models.m2_msr import CompuMethod
from ....models.port_interface import ClientServerInterface, DataInterface, PortInterface, SenderReceiverInterface
from ....models.sw_component import ApplicationSwComponentType, AtomicSwComponentType, CompositionSwComponentType, EcuAbstractionSwComponentType, ServiceSwComponentType, SwComponentType

class TestAUTOSAR:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import pytest

from armodel.models.ar_ref import ArVariableInImplementationDataInstanceRef, AutosarVariableRef, ProvidedPortPrototypeInstanceRef, RequiredPortPrototypeInstanceRef
from armodel.models.ar_ref import OperationInAtomicSwcInstanceRef, POperationInAtomicSwcInstanceRef, ROperationInAtomicSwcInstanceRef, RefType, TRefType, AtpInstanceRef
from armodel.models.general_structure import ARObject
from ....models.ar_ref import ArVariableInImplementationDataInstanceRef, AutosarVariableRef, ProvidedPortPrototypeInstanceRef, RequiredPortPrototypeInstanceRef
from ....models.ar_ref import OperationInAtomicSwcInstanceRef, POperationInAtomicSwcInstanceRef, ROperationInAtomicSwcInstanceRef, RefType, TRefType, AtpInstanceRef
from ....models.general_structure import ARObject


class TestARRef:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest

from armodel.models.bsw_module_template import BswModuleDescription, BswModuleEntry, BswModuleEntity, BswCalledEntity
from armodel import AUTOSAR
from ....models.bsw_module_template import BswModuleDescription, BswModuleEntry, BswModuleEntity, BswCalledEntity
from .... import AUTOSAR

class TestBswModuleDescription:
def test_construct(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import pytest

from armodel import AUTOSAR
from armodel.models.common_structure import AbstractImplementationDataTypeElement, ConstantReference, ImplementationDataTypeElement, ValueSpecification, ConstantSpecification, ExecutableEntity
from armodel.models.datatype import AbstractImplementationDataType
from armodel.models.general_structure import ARElement, ARObject, CollectableElement, Identifiable
from armodel.models.general_structure import MultilanguageReferrable, PackageableElement, Referrable
from .... import AUTOSAR
from ....models.common_structure import AbstractImplementationDataTypeElement, ConstantReference, ImplementationDataTypeElement, ValueSpecification, ConstantSpecification, ExecutableEntity
from ....models.datatype import AbstractImplementationDataType
from ....models.general_structure import ARElement, ARObject, CollectableElement, Identifiable
from ....models.general_structure import MultilanguageReferrable, PackageableElement, Referrable

class Test_M2_AUTOSARTemplates_CommonStructure_Constants:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest

from armodel.models.data_dictionary import SwDataDefProps, SwPointerTargetProps
from armodel.models.general_structure import ARObject
from ....models.data_dictionary import SwDataDefProps, SwPointerTargetProps
from ....models.general_structure import ARObject

class Test_M2_MSR_DataDictionary_DataDefProperties:
def test_SwDataDefProps(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import pytest
from armodel import AUTOSAR
from armodel.models.ar_ref import RefType
from armodel.models.data_prototype import ApplicationArrayElement, ApplicationCompositeElementDataPrototype, ApplicationRecordElement, AtpPrototype, AutosarDataPrototype, DataPrototype, VariableDataPrototype
from armodel.models.general_structure import ARObject, AtpFeature, Identifiable, MultilanguageReferrable, Referrable

from .... import AUTOSAR
from ....models.ar_ref import RefType
from ....models.data_prototype import ApplicationArrayElement, ApplicationCompositeElementDataPrototype, ApplicationRecordElement, AtpPrototype, AutosarDataPrototype, DataPrototype, VariableDataPrototype
from ....models.general_structure import ARObject, AtpFeature, Identifiable, MultilanguageReferrable, Referrable

class Test_M2_AUTOSARTemplates_SWComponentTemplate_Datatype_DataPrototypes:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import pytest

from armodel import AUTOSAR
from armodel.models import datatype
from armodel.models.common_structure import ImplementationDataTypeElement
from armodel.models.data_prototype import ApplicationRecordElement
from armodel.models.datatype import AbstractImplementationDataType, ApplicationArrayDataType, ApplicationCompositeDataType, ApplicationDataType, ApplicationPrimitiveDataType, ApplicationRecordDataType, AtpType, AutosarDataType, BaseType, DataTypeMap, DataTypeMappingSet, ImplementationDataType, ImplementationProps, SwBaseType, SymbolProps
from armodel.models.general_structure import ARElement, ARObject, CollectableElement, Identifiable, MultilanguageReferrable, PackageableElement, Referrable
from .... import AUTOSAR
from ....models import datatype
from ....models.common_structure import ImplementationDataTypeElement
from ....models.data_prototype import ApplicationRecordElement
from ....models.datatype import AbstractImplementationDataType, ApplicationArrayDataType, ApplicationCompositeDataType, ApplicationDataType, ApplicationPrimitiveDataType, ApplicationRecordDataType, AtpType, AutosarDataType, BaseType, DataTypeMap, DataTypeMappingSet, ImplementationDataType, ImplementationProps, SwBaseType, SymbolProps
from ....models.general_structure import ARElement, ARObject, CollectableElement, Identifiable, MultilanguageReferrable, PackageableElement, Referrable

class Test_M2_AUTOSARTemplates_CommonStructure_Implementation:
def test_ImplementationProps(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pytest
from armodel.models.ar_package import AUTOSAR
from armodel.models.general_structure import ARElement, ARObject, AtpFeature, CollectableElement, Identifiable, Limit, MultilanguageReferrable, PackageableElement, Referrable

from ....models.ar_package import AUTOSAR
from ....models.general_structure import ARElement, ARObject, AtpFeature, CollectableElement, Identifiable, Limit, MultilanguageReferrable, PackageableElement, Referrable

class TestGeneralStructure:
def test_ar_object(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import pytest

from armodel import AUTOSAR
from armodel.models.general_structure import ARObject
from armodel.models.m2_msr import Compu, CompuConst, CompuConstContent, CompuConstNumericContent, CompuConstTextContent, CompuContent, CompuScale, CompuScales
from .... import AUTOSAR
from ....models.general_structure import ARObject
from ....models.m2_msr import Compu, CompuConst, CompuConstContent, CompuConstNumericContent, CompuConstTextContent, CompuContent, CompuScale, CompuScales

class Test_M2_MSR_AsamHdo_ComputationMethod:
def test_CompuContent(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import pytest

from armodel.models.ar_package import AUTOSAR
from armodel.models.ar_ref import RefType
from armodel.models.data_prototype import AtpPrototype, AutosarDataPrototype, DataPrototype, VariableDataPrototype
from armodel.models.datatype import AtpType
from armodel.models.general_structure import ARElement, ARObject, AtpFeature, CollectableElement, Identifiable, MultilanguageReferrable, PackageableElement, Referrable
from armodel.models.port_interface import ApplicationError, ArgumentDataPrototype, ClientServerInterface, ClientServerOperation, DataInterface, NvDataInterface, ParameterInterface, PortInterface, SenderReceiverInterface
from ....models.ar_package import AUTOSAR
from ....models.ar_ref import RefType
from ....models.data_prototype import AtpPrototype, AutosarDataPrototype, DataPrototype, VariableDataPrototype
from ....models.datatype import AtpType
from ....models.general_structure import ARElement, ARObject, AtpFeature, CollectableElement, Identifiable, MultilanguageReferrable, PackageableElement, Referrable
from ....models.port_interface import ApplicationError, ArgumentDataPrototype, ClientServerInterface, ClientServerOperation, DataInterface, NvDataInterface, ParameterInterface, PortInterface, SenderReceiverInterface


class Test_M2_AUTOSARTemplates_SWComponentTemplate_PortInterface:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from armodel.models.port_prototype import PPortComSpec, RPortComSpec
from ....models.port_prototype import PPortComSpec, RPortComSpec

class Test_PortProtype:
def test_PPortComSpec(self):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from armodel import AUTOSAR, ARPackage
from armodel import ARXMLParser
from .... import AUTOSAR, ARPackage
from .... import ARXMLParser

import logging

Expand All @@ -10,7 +10,7 @@ def setup_method(self):
document = AUTOSAR.getInstance()
document.clear()
parser = ARXMLParser()
parser.load("tests/test_files/BswM_Bswmd.arxml", document)
parser.load("src/armodel/tests/test_files/BswM_Bswmd.arxml", document)

def test_ar_packages(self):
document = AUTOSAR.getInstance()
Expand Down
File renamed without changes.

0 comments on commit 103b339

Please sign in to comment.