Skip to content

Commit

Permalink
Fix tests on windows/with new 8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
IanCa committed Jun 4, 2024
1 parent 1151024 commit 2f2e472
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion tests/schema/test_ontology_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def test_update_dataframes_from_schema(self):
try:
updated_dataframes = update_dataframes_from_schema(schema_dataframes_new, schema)
except HedFileError as e:
self.assertEqual(len(e.issues), 111)
self.assertEqual(len(e.issues), 115)
breakHere = 3


Expand Down
22 changes: 11 additions & 11 deletions tests/scripts/test_script_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ def test_regular_extension(self):
def test_tsv_extension(self):
"""Test that .tsv extensions are handled differently."""
# Assuming the function correctly handles paths with directories
self.assertEqual(add_extension("path/to/filename", ".tsv"), "path/to/hedtsv/filename")
self.assertEqual(add_extension(os.path.normpath("path/to/filename"), ".tsv"), os.path.normpath("path/to/hedtsv/filename"))
# Testing with a basename only
self.assertEqual(add_extension("filename", ".tsv"), "hedtsv/filename")
self.assertEqual(add_extension("filename", ".tsv"), os.path.normpath("hedtsv/filename"))

def test_empty_extension(self):
"""Test adding an empty extension."""
Expand All @@ -33,7 +33,7 @@ class TestSortBaseSchemas(unittest.TestCase):
def test_mixed_file_types(self):
filenames = [
"test_schema.mediawiki",
"hedtsv/test_schema/test_schema_Tag.tsv",
os.path.normpath("hedtsv/test_schema/test_schema_Tag.tsv"),
"other_schema.xml"
]
expected = {
Expand All @@ -45,9 +45,9 @@ def test_mixed_file_types(self):

def test_tsv_in_correct_subfolder(self):
filenames = [
"hedtsv/test_schema/test_schema_Tag.tsv",
"hedtsv/test_schema/test_schema_Tag.tsv",
"hedtsv/wrong_folder/wrong_name_Tag.tsv" # Should be ignored
os.path.normpath("hedtsv/test_schema/test_schema_Tag.tsv"),
os.path.normpath("hedtsv/test_schema/test_schema_Tag.tsv"),
os.path.normpath("hedtsv/wrong_folder/wrong_name_Tag.tsv") # Should be ignored
]
expected = {
"test_schema": {".tsv"}
Expand All @@ -57,20 +57,20 @@ def test_tsv_in_correct_subfolder(self):

def test_tsv_in_correct_subfolder2(self):
filenames = [
"prerelease/hedtsv/test_schema/test_schema_Tag.tsv",
"prerelease/hedtsv/test_schema/test_schema_Tag.tsv",
"prerelease/hedtsv/wrong_folder/wrong_name_Tag.tsv" # Should be ignored
os.path.normpath("prerelease/hedtsv/test_schema/test_schema_Tag.tsv"),
os.path.normpath("prerelease/hedtsv/test_schema/test_schema_Tag.tsv"),
os.path.normpath("prerelease/hedtsv/wrong_folder/wrong_name_Tag.tsv") # Should be ignored
]
expected = {
"prerelease/test_schema": {".tsv"}
os.path.normpath("prerelease/test_schema"): {".tsv"}
}
result = sort_base_schemas(filenames)
self.assertEqual(dict(result), expected)

def test_ignored_files(self):
filenames = [
"test_schema.mediawiki",
"not_hedtsv/test_schema/test_schema_Tag.tsv" # Should be ignored
os.path.normpath("not_hedtsv/test_schema/test_schema_Tag.tsv") # Should be ignored
]
expected = {
"test_schema": {".mediawiki"}
Expand Down

0 comments on commit 2f2e472

Please sign in to comment.