Skip to content

Commit

Permalink
for py39 and linux...
Browse files Browse the repository at this point in the history
  • Loading branch information
F-Bk committed Jan 15, 2025
1 parent c1427c5 commit cd70d1e
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env python
import codecs
import sys
from pathlib import Path
from typing import Union
from unittest import mock
import urllib
import urllib.request
Expand Down Expand Up @@ -39,7 +41,7 @@ def setUp(self):
self.assertEqual(self.widget.can_database_list.count(), 0)
self.assertEqual(self.widget.lin_database_list.count(), 0)

def load_database(self, path: Path | str | None = None, is_can=True):
def load_database(self, path: Union[Path, str, None] = None, is_can=True):
"""
Load database to CAN/LIN database list
Parameters
Expand Down Expand Up @@ -246,7 +248,7 @@ def test_extract_bus_csv_btn_0(self):
self.mouse_click_on_btn_with_progress(self.widget.extract_bus_csv_btn)

csv_tables = [
(file, pd.read_csv(file)) for file in Path(self.test_workspace).iterdir() if file.suffix == ".csv"
(file, pd.read_csv(file)) for file in sorted(Path(self.test_workspace).iterdir()) if file.suffix == ".csv"
]
with OpenMDF(compare_to_file_path) as mdf_file:
for group, (path, table) in zip(mdf_file.groups, csv_tables):
Expand All @@ -263,6 +265,7 @@ def test_extract_bus_csv_btn_0(self):
for channel in group.channels:
if channel.name != "time":
name = prefix + channel.name

self.assertIn(name, table.columns)
ch = mdf_file.get(channel.name)

Expand Down Expand Up @@ -350,7 +353,7 @@ def test_extract_bus_csv_btn_1(self):
name = prefix + ch.name
self.assertIn(name, csv_table.columns)
column = csv_table[name]
if ch.unit:
if ch.unit and (sys.platform == "win32"):
self.assertEqual(ch.unit, column.columns[0])

# Evaluate channel samples
Expand Down

0 comments on commit cd70d1e

Please sign in to comment.