Skip to content

Commit b257a6d

Browse files
committed
Very janky fix for the sorting issue between Arch and Debian
1 parent 9009636 commit b257a6d

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

tests/__snapshots__/test_stuff.ambr

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,29 @@
2020
# ---
2121
# name: test_copyAllFiles
2222
list([
23+
'ajs/',
24+
'astatic/',
2325
'blankDir/',
24-
' index.html',
25-
' myRack.html',
26-
' bonescrawlhome.html',
27-
' bonesrunhome.html',
28-
' bonesboundhome.html',
29-
' report.html',
30-
' template.html',
31-
' bonescallhome.html',
32-
' 404.html',
33-
' robots.txt',
34-
' emacsFiles.html',
35-
' Power7.html',
36-
' contact.html',
37-
' static/',
38-
' theDreadedTexFile.tex',
39-
' styles.css',
40-
' favicon.ico',
41-
' theIdioticTimeDistributionOfAReport.pdf',
42-
' js/',
43-
' preloadImages.js',
44-
' minimal-theme-switcher.js',
45-
' anotherThemeChanger.js',
26+
'z404.html',
27+
'zPower7.html',
28+
'zbonesboundhome.html',
29+
'zbonescallhome.html',
30+
'zbonescrawlhome.html',
31+
'zbonesrunhome.html',
32+
'zcontact.html',
33+
'zemacsFiles.html',
34+
'zindex.html',
35+
'zmyRack.html',
36+
'zreport.html',
37+
'zrobots.txt',
38+
'ztemplate.html',
39+
'zzanotherThemeChanger.js',
40+
'zzfavicon.ico',
41+
'zzminimal-theme-switcher.js',
42+
'zzpreloadImages.js',
43+
'zzstyles.css',
44+
'zztheDreadedTexFile.tex',
45+
'zztheIdioticTimeDistributionOfAReport.pdf',
4646
])
4747
# ---
4848
# name: test_dir

tests/test_stuff.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ def test_copyAllFiles(snapshot):
103103
outputCheck = []
104104
for root, dirs, files in os.walk("tests/testFolder/blankDir"): # Gratefully borrowed from here https://stackoverflow.com/questions/9727673/list-directory-tree-structure-in-python
105105
level = root.replace("tests/testFolder/blankDir", '').count(os.sep) # As dir structure is important to track if it changes in this test so formatting the output makes sense
106-
indent = ' ' * 4 * (level)
106+
indent = 'a' * (level)
107107
outputCheck.append(('{}{}/'.format(indent, os.path.basename(root))))
108-
subindent = ' ' * 4 * (level + 1)
108+
subindent = 'z'* (level + 1)
109109
for f in files:
110110
outputCheck.append(('{}{}'.format(subindent, f)))
111111
shutil.rmtree("tests/testFolder/blankDir")
112-
assert outputCheck == snapshot
112+
assert sorted(outputCheck) == snapshot # For some reason Arch and Debian seem to sort files differently idk
113113

114114
# inputFiles = ssri.getListOfFilesToSearchDir("tests/testFolder/staging", ["tests/testFolder/sites"], True, False)
115115
# knownGoodFiles = ssri.getListOfFilesToSearchDir("tests/testFolder/staging", ["tests/testFolder/sites"], True, False) # This is me being lazy and using getListOfFiles to get an array for the known good copy of sites

0 commit comments

Comments
 (0)