hanojiang 2 lat temu
commit
eb9a131bf4
5 zmienionych plików z 85 dodań i 0 usunięć
  1. 5 0
      .gitignore
  2. 55 0
      Base/SignalInitTableCheck.py
  3. 11 0
      all.py
  4. 14 0
      testcase/test_case.py
  5. BIN
      问题梳理.xlsx

+ 5 - 0
.gitignore

@@ -0,0 +1,5 @@
+report/*
+result/*
+.pytest_cache/*
+.idea/*
+*.pyc

+ 55 - 0
Base/SignalInitTableCheck.py

@@ -0,0 +1,55 @@
+# -*- coding: UTF-8 -*-
+"""
+@Project :Matrix_Check 
+@File    :SignalInitTableCheck.py
+@Author  :haojiang
+@Date    :2022/9/28 18:15 
+"""
+
+import csv
+from enum import Enum
+
+class TableColumnHeaderType(Enum):
+    Signal = 0
+    Type = 1
+    Bit = 2
+    App = 3
+    AppValue = 4
+    Raw = 5
+    RawValue = 6
+    Controller = 7
+    Frame = 8
+    PDU = 9
+
+
+
+class SignalInitTableCheck:
+
+    Column_Need_Check = [TableColumnHeaderType.Signal.value,
+                         TableColumnHeaderType.Type.value,
+                         TableColumnHeaderType.Bit.value,
+                         TableColumnHeaderType.RawValue.value]
+
+    def __init__(self):
+        pass
+
+    def get_csv_data(self, file_name: str):
+        with open(file_name, 'r') as csvfile:
+            spamreader = csv.reader(csvfile, delimiter=',')
+            is_header_readed = False
+            table_data = list()
+            for row in spamreader:
+                if not is_header_readed:
+                    is_header_readed = True
+                    continue
+
+                table_data.append([row[column] for column in SignalInitTableCheck.Column_Need_Check])
+
+        return table_data
+
+
+if __name__ == '__main__':
+    matrix_path = r'D:\01_Work\02_WP\EP39_EREV\branch\src\MatrixAssistant_V2.0\EP39_EREV_SIMU+_GW\20220729-qy1-EP39EREV_SIMU+_GW_Rx_初值表.csv'
+
+    sc = SignalInitTableCheck()
+    sc.get_csv_data(matrix_path)

+ 11 - 0
all.py

@@ -0,0 +1,11 @@
+import os
+
+import pytest
+import logging
+
+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/'])
+    # os.system('allure generate ./result/ -o ./report --clean')

+ 14 - 0
testcase/test_case.py

@@ -0,0 +1,14 @@
+# -*- coding: UTF-8 -*-
+"""
+@Project :pytest_src 
+@File    :test_case.py
+@Author  :haojiang
+@Date    :2022/9/23 10:09 
+"""
+import allure
+import pytest
+
+
+
+def test_01_excel_check():
+    pass

BIN
问题梳理.xlsx