Kaynağa Gözat

update input data foramt

hanojiang 2 yıl önce
ebeveyn
işleme
d4db0911c2

+ 46 - 51
.idea/workspace.xml

@@ -3,7 +3,10 @@
   <component name="ChangeListManager">
     <list default="true" id="95170716-16e9-467a-973d-c2f0cc971440" name="Default Changelist" comment="">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/reportname.html" beforeDir="false" afterPath="$PROJECT_DIR$/reportname.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/Data/CheckList.xlsx" beforeDir="false" afterPath="$PROJECT_DIR$/Data/CheckList.xlsx" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/Data/DataAccess.py" beforeDir="false" afterPath="$PROJECT_DIR$/Data/DataAccess.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/all.py" beforeDir="false" afterPath="$PROJECT_DIR$/all.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/reportname.html" beforeDir="false" />
       <change beforePath="$PROJECT_DIR$/testcase/test_case.py" beforeDir="false" afterPath="$PROJECT_DIR$/testcase/test_case.py" afterDir="false" />
     </list>
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@@ -17,8 +20,8 @@
       <file pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/all.py">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="114">
-              <caret line="9" column="60" selection-start-line="9" selection-start-column="56" selection-end-line="9" selection-end-column="60" />
+            <state relative-caret-position="95">
+              <caret line="10" column="40" selection-start-line="10" selection-start-column="40" selection-end-line="10" selection-end-column="40" />
               <folding>
                 <element signature="e#0#9#0" expanded="true" />
               </folding>
@@ -29,11 +32,8 @@
       <file pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/Base/CfgCheckBase.py">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="836">
-              <caret line="47" column="118" selection-start-line="47" selection-start-column="19" selection-end-line="47" selection-end-column="118" />
-              <folding>
-                <element signature="e#125#147#0" expanded="true" />
-              </folding>
+            <state relative-caret-position="152">
+              <caret line="8" selection-start-line="8" selection-end-line="8" />
             </state>
           </provider>
         </entry>
@@ -62,14 +62,20 @@
           </provider>
         </entry>
       </file>
-      <file pinned="false" current-in-tab="true">
+      <file pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/testcase/test_case.py">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="285">
-              <caret line="15" column="31" selection-start-line="15" selection-start-column="31" selection-end-line="15" selection-end-column="31" />
-              <folding>
-                <element signature="e#123#136#0" expanded="true" />
-              </folding>
+            <state relative-caret-position="209">
+              <caret line="11" selection-start-line="11" selection-end-line="11" selection-end-column="52" />
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file pinned="false" current-in-tab="true">
+        <entry file="file://$PROJECT_DIR$/Cfg.py">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="247">
+              <caret line="13" column="25" selection-start-line="13" selection-start-column="25" selection-end-line="13" selection-end-column="25" />
             </state>
           </provider>
         </entry>
@@ -95,8 +101,8 @@
       <file pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/Data/DataAccess.py">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="1444">
-              <caret line="78" column="34" selection-start-line="78" selection-start-column="34" selection-end-line="78" selection-end-column="34" />
+            <state relative-caret-position="1501">
+              <caret line="81" selection-start-line="81" selection-end-line="81" />
             </state>
           </provider>
         </entry>
@@ -136,10 +142,11 @@
         <option value="$PROJECT_DIR$/testcase/test_dcm.py" />
         <option value="$PROJECT_DIR$/Base/ModuleCfgCheck.py" />
         <option value="$PROJECT_DIR$/Base/BaseContainer.py" />
-        <option value="$PROJECT_DIR$/all.py" />
         <option value="$PROJECT_DIR$/Base/Arxml.py" />
         <option value="$PROJECT_DIR$/Data/DataAccess.py" />
         <option value="$PROJECT_DIR$/testcase/test_case.py" />
+        <option value="$PROJECT_DIR$/all.py" />
+        <option value="$PROJECT_DIR$/Cfg.py" />
       </list>
     </option>
   </component>
@@ -155,7 +162,6 @@
       <foldersAlwaysOnTop value="true" />
     </navigator>
     <panes>
-      <pane id="Scope" />
       <pane id="ProjectPane">
         <subPane>
           <expand>
@@ -163,25 +169,11 @@
               <item name="pytest_src" type="b2602c69:ProjectViewProjectNode" />
               <item name="pytest_src" type="462c0819:PsiDirectoryNode" />
             </path>
-            <path>
-              <item name="pytest_src" type="b2602c69:ProjectViewProjectNode" />
-              <item name="pytest_src" type="462c0819:PsiDirectoryNode" />
-              <item name="Base" type="462c0819:PsiDirectoryNode" />
-            </path>
-            <path>
-              <item name="pytest_src" type="b2602c69:ProjectViewProjectNode" />
-              <item name="pytest_src" type="462c0819:PsiDirectoryNode" />
-              <item name="Data" type="462c0819:PsiDirectoryNode" />
-            </path>
-            <path>
-              <item name="pytest_src" type="b2602c69:ProjectViewProjectNode" />
-              <item name="pytest_src" type="462c0819:PsiDirectoryNode" />
-              <item name="testcase" type="462c0819:PsiDirectoryNode" />
-            </path>
           </expand>
           <select />
         </subPane>
       </pane>
+      <pane id="Scope" />
     </panes>
   </component>
   <component name="PropertiesComponent">
@@ -344,6 +336,8 @@
       <workItem from="1664528095262" duration="123000" />
       <workItem from="1665452799614" duration="1521000" />
       <workItem from="1665468447370" duration="8000" />
+      <workItem from="1665983559850" duration="2120000" />
+      <workItem from="1666003525869" duration="12000" />
     </task>
     <servers />
   </component>
@@ -380,14 +374,14 @@
     </history-entry>
   </component>
   <component name="TimeTrackingManager">
-    <option name="totallyTimeSpent" value="60406000" />
+    <option name="totallyTimeSpent" value="62538000" />
   </component>
   <component name="ToolWindowManager">
     <frame x="-7" y="-7" width="2062" height="1294" extended-state="6" />
     <editor active="true" />
     <layout>
       <window_info id="Favorites" order="0" side_tool="true" />
-      <window_info active="true" content_ui="combo" id="Project" order="1" visible="true" weight="0.17932068" />
+      <window_info active="true" content_ui="combo" id="Project" order="1" visible="true" weight="0.18231769" />
       <window_info id="Structure" order="2" side_tool="true" weight="0.25" />
       <window_info anchor="bottom" id="Database Changes" order="0" />
       <window_info anchor="bottom" id="Terminal" order="1" weight="0.44224137" />
@@ -440,7 +434,7 @@
     <SUITE FILE_PATH="coverage/pytest_src$DataAccess.coverage" NAME="DataAccess Coverage Results" MODIFIED="1664009099956" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/Data" />
     <SUITE FILE_PATH="coverage/pytest_src$pytest_for_test_case_test_04_case.coverage" NAME="pytest for test_case.test_04_case Coverage Results" MODIFIED="1664085346123" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/testcase" />
     <SUITE FILE_PATH="coverage/pytest_src$pytest_for_test_dcm_test_01_case.coverage" NAME="pytest for test_dcm.test_01_case Coverage Results" MODIFIED="1663913935826" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/testcase" />
-    <SUITE FILE_PATH="coverage/pytest_src$all.coverage" NAME="all Coverage Results" MODIFIED="1665453107769" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
+    <SUITE FILE_PATH="coverage/pytest_src$all.coverage" NAME="all Coverage Results" MODIFIED="1665984483952" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
     <SUITE FILE_PATH="coverage/pytest_src$CfgCheckBase.coverage" NAME="CfgCheckBase Coverage Results" MODIFIED="1663898494426" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/Base" />
     <SUITE FILE_PATH="coverage/pytest_src$ModuleCfgCheck.coverage" NAME="ModuleCfgCheck Coverage Results" MODIFIED="1663909713613" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/Base" />
   </component>
@@ -495,8 +489,8 @@
     </entry>
     <entry file="file://$PROJECT_DIR$/all.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="114">
-          <caret line="9" column="60" selection-start-line="9" selection-start-column="56" selection-end-line="9" selection-end-column="60" />
+        <state relative-caret-position="95">
+          <caret line="10" column="40" selection-start-line="10" selection-start-column="40" selection-end-line="10" selection-end-column="40" />
           <folding>
             <element signature="e#0#9#0" expanded="true" />
           </folding>
@@ -505,11 +499,8 @@
     </entry>
     <entry file="file://$PROJECT_DIR$/Base/CfgCheckBase.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="836">
-          <caret line="47" column="118" selection-start-line="47" selection-start-column="19" selection-end-line="47" selection-end-column="118" />
-          <folding>
-            <element signature="e#125#147#0" expanded="true" />
-          </folding>
+        <state relative-caret-position="152">
+          <caret line="8" selection-start-line="8" selection-end-line="8" />
         </state>
       </provider>
     </entry>
@@ -533,6 +524,13 @@
         </state>
       </provider>
     </entry>
+    <entry file="file://$PROJECT_DIR$/testcase/test_case.py">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="209">
+          <caret line="11" selection-start-line="11" selection-end-line="11" selection-end-column="52" />
+        </state>
+      </provider>
+    </entry>
     <entry file="file://$PROJECT_DIR$/Base/BaseContainer.py">
       <provider selected="true" editor-type-id="text-editor">
         <state relative-caret-position="741">
@@ -549,8 +547,8 @@
     </entry>
     <entry file="file://$PROJECT_DIR$/Data/DataAccess.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="1444">
-          <caret line="78" column="34" selection-start-line="78" selection-start-column="34" selection-end-line="78" selection-end-column="34" />
+        <state relative-caret-position="1501">
+          <caret line="81" selection-start-line="81" selection-end-line="81" />
         </state>
       </provider>
     </entry>
@@ -561,13 +559,10 @@
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/testcase/test_case.py">
+    <entry file="file://$PROJECT_DIR$/Cfg.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="285">
-          <caret line="15" column="31" selection-start-line="15" selection-start-column="31" selection-end-line="15" selection-end-column="31" />
-          <folding>
-            <element signature="e#123#136#0" expanded="true" />
-          </folding>
+        <state relative-caret-position="247">
+          <caret line="13" column="25" selection-start-line="13" selection-start-column="25" selection-end-line="13" selection-end-column="25" />
         </state>
       </provider>
     </entry>

+ 14 - 0
Cfg.py

@@ -0,0 +1,14 @@
+# -*- coding: UTF-8 -*-
+"""
+@Project :pytest_src 
+@File    :Cfg.py
+@Author  :haojiang
+@Date    :2022/10/17 13:31 
+"""
+from Data.DataAccess import HardwareType, ProjectType
+
+HARDWARE_TYPE = HardwareType.GW04
+PROJECT_TYPE = ProjectType.AS33
+PROJECT = r'D:\01_Work\02_WP\EC32\branch\src\Config\ECUC'
+
+PROJECT_VERSION = 'V7.1a'

BIN
Data/CheckList.xlsx


+ 18 - 10
Data/DataAccess.py

@@ -12,14 +12,15 @@ from openpyxl import load_workbook
 CHECK_LIST_FILE = r'./Data/CheckList.xlsx'
 
 class ColumHeader(Enum):
-    Project = 0
-    Module = 1
-    ConfigurationItem = 2
-    Type = 3
-    ExpectValue = 4
-    SearchPattern = 5
-    SearchText = 6
-    SearchRule = 7
+    Hardware = 0
+    Project = 1
+    Module = 2
+    ConfigurationItem = 3
+    Type = 4
+    ExpectValue = 5
+    SearchPattern = 6
+    SearchText = 7
+    SearchRule = 8
 
 
 class ItemType(Enum):
@@ -27,11 +28,16 @@ class ItemType(Enum):
     CUSTOM_PATTERN = 1
     DEPENDENCY_PATTERN = 2
 
-class ProjectType(Enum):
+class HardwareType(Enum):
     ALL = 0
     GW04 = 1
     CCP = 2
 
+class ProjectType(Enum):
+    ALL = 0
+    AS33 = 1
+    AS33P = 2
+
 ItemRule = {
     ItemType.FIXED_VALUE: (
         ColumHeader.Module.value,
@@ -69,7 +75,7 @@ def get_item_by_item_type(item_type: ItemType, row_data):
 
     return tuple(ret_data)
 
-def get_xlsx_data_by_filter(project: ProjectType, item_type: ItemType):
+def get_xlsx_data_by_filter(hardware: HardwareType, project: ProjectType, item_type: ItemType):
 
     wb = load_workbook(CHECK_LIST_FILE)
     sheet1 = wb.active
@@ -78,6 +84,8 @@ def get_xlsx_data_by_filter(project: ProjectType, item_type: ItemType):
 
     for row in sheet1.iter_rows():
         if row[ColumHeader.Type.value].value == item_type.name \
+                and (row[ColumHeader.Hardware.value].value == hardware.name
+                     or row[ColumHeader.Hardware.value].value == HardwareType.ALL.name) \
                 and (row[ColumHeader.Project.value].value == project.name
                      or row[ColumHeader.Project.value].value == ProjectType.ALL.name):
             ret_data_table.append(get_item_by_item_type(item_type, row))

BIN
Data/__pycache__/DataAccess.cpython-39.pyc


Dosya farkı çok büyük olduğundan ihmal edildi
+ 6 - 7
GW04_AS33_V7.1a.html


+ 3 - 1
all.py

@@ -3,9 +3,11 @@ import os
 import pytest
 import logging
 
+from Cfg import HARDWARE_TYPE, PROJECT_TYPE, PROJECT_VERSION
+
 if __name__ == '__main__':
     logging.basicConfig(level=logging.INFO)
     # pytest.main(['./testcase', '--html=reportname.html'])
     os.system('del /f /q report result')
-    pytest.main(['./testcase', '-v', '--html=reportname.html', '--alluredir', './result/'])
+    pytest.main(['./testcase', '-v', f'--html={HARDWARE_TYPE.name}_{PROJECT_TYPE.name}_{PROJECT_VERSION}.html', '--alluredir', './result/'])
     # os.system('allure generate ./result/ -o ./report --clean')

BIN
testcase/__pycache__/test_case.cpython-39-pytest-7.1.3.pyc


+ 8 - 5
testcase/test_case.py

@@ -9,16 +9,19 @@ import allure
 import pytest
 
 from Base.ModuleCfgCheck import ModuleCfgCheck, check_module_param_check
-from Data.DataAccess import ItemType, get_xlsx_data_by_filter, ProjectType
+from Cfg import HARDWARE_TYPE, PROJECT_TYPE, PROJECT
+from Data.DataAccess import ItemType, get_xlsx_data_by_filter, HardwareType, ProjectType
 from Base.Arxml import Arxml
 from Base.BaseContainer import EcucContainerValue
 
-PROJECT_TYPE = ProjectType.GW04
-PROJECT = r'D:\01_Work\02_WP\AS33\branch\src_v6_1\Config\ECUC'
+
+# HARDWARE_TYPE = HardwareType.GW04
+# PROJECT_TYPE = ProjectType.AS33
+# PROJECT = r'D:\01_Work\02_WP\EC32\branch\src\Config\ECUC'
 # PROJECT = r'D:\01_Work\02_WP\EP39_EV\branch\src\Config\ECUC'
 
 @allure.feature('Fix Value Parameter Check')
-@pytest.mark.parametrize("module_name, param_name, expect_value", get_xlsx_data_by_filter(PROJECT_TYPE, ItemType.FIXED_VALUE))
+@pytest.mark.parametrize("module_name, param_name, expect_value", get_xlsx_data_by_filter(HARDWARE_TYPE, PROJECT_TYPE, ItemType.FIXED_VALUE))
 def test_fix_value_case(module_name, param_name, expect_value):
     '''
     该用例适用于 对某一配置项值进行检查,可能有多个container 都具有该配置项,但所有配置项的值都相同,为一固定值。
@@ -34,7 +37,7 @@ def test_fix_value_case(module_name, param_name, expect_value):
     assert True == res
 
 @allure.feature('Custom Pattern Parameter Check')
-@pytest.mark.parametrize("module_name, search_pattern, param_name, expect_value",  get_xlsx_data_by_filter(PROJECT_TYPE, ItemType.CUSTOM_PATTERN))
+@pytest.mark.parametrize("module_name, search_pattern, param_name, expect_value", get_xlsx_data_by_filter(HARDWARE_TYPE, PROJECT_TYPE, ItemType.CUSTOM_PATTERN))
 def test_custom_pattern_case(module_name, search_pattern, param_name, expect_value):
     '''
     该用例适用于测试 通过某种模式规则,定位到唯一的container, 该container包含的指定配置项,是否与期望值相同。

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor