Skip to content

Commit

Permalink
Change sorted to sort lists not tuples containing lists
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebagabones committed Dec 26, 2024
1 parent 3f1ec81 commit fe97f32
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 48 deletions.
88 changes: 44 additions & 44 deletions tests/__snapshots__/test_stuff.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -33,68 +33,68 @@
Namespace(dir=False, inputFile=['inputFile'], templates_dir=None, output='.', no_warnings=False, verbose=False)
# ---
# name: test_lookForInclude
list([
list([
'tests/testFolder/sites/index.html',
'tests/testFolder/sites/myRack.html',
'tests/testFolder/sites/bonescrawlhome.html',
'tests/testFolder/sites/bonesrunhome.html',
'tests/testFolder/sites/bonesboundhome.html',
'tests/testFolder/sites/report.html',
'tests/testFolder/sites/template.html',
'tests/testFolder/sites/bonescallhome.html',
'tests/testFolder/sites/404.html',
'tests/testFolder/sites/emacsFiles.html',
'tests/testFolder/sites/Power7.html',
'tests/testFolder/sites/contact.html',
]),
tuple(
list([
'tests/testFolder/staging/index.html',
'tests/testFolder/staging/myRack.html',
'tests/testFolder/staging/404.html',
'tests/testFolder/staging/Power7.html',
'tests/testFolder/staging/bonesboundhome.html',
'tests/testFolder/staging/bonescallhome.html',
'tests/testFolder/staging/bonescrawlhome.html',
'tests/testFolder/staging/bonesrunhome.html',
'tests/testFolder/staging/bonesboundhome.html',
'tests/testFolder/staging/contact.html',
'tests/testFolder/staging/emacsFiles.html',
'tests/testFolder/staging/index.html',
'tests/testFolder/staging/myRack.html',
'tests/testFolder/staging/report.html',
'tests/testFolder/staging/template.html',
'tests/testFolder/staging/bonescallhome.html',
'tests/testFolder/staging/404.html',
'tests/testFolder/staging/emacsFiles.html',
'tests/testFolder/staging/Power7.html',
'tests/testFolder/staging/contact.html',
]),
])
# ---
# name: test_readfilesDir
list([
list([
'tests/testFolder/sites/index.html',
'tests/testFolder/sites/myRack.html',
'tests/testFolder/sites/404.html',
'tests/testFolder/sites/Power7.html',
'tests/testFolder/sites/bonesboundhome.html',
'tests/testFolder/sites/bonescallhome.html',
'tests/testFolder/sites/bonescrawlhome.html',
'tests/testFolder/sites/bonesrunhome.html',
'tests/testFolder/sites/bonesboundhome.html',
'tests/testFolder/sites/contact.html',
'tests/testFolder/sites/emacsFiles.html',
'tests/testFolder/sites/index.html',
'tests/testFolder/sites/myRack.html',
'tests/testFolder/sites/report.html',
'tests/testFolder/sites/template.html',
'tests/testFolder/sites/bonescallhome.html',
'tests/testFolder/sites/404.html',
'tests/testFolder/sites/emacsFiles.html',
'tests/testFolder/sites/Power7.html',
'tests/testFolder/sites/contact.html',
]),
)
# ---
# name: test_readfilesDir
tuple(
list([
'tests/testFolder/staging/index.html',
'tests/testFolder/staging/myRack.html',
'tests/testFolder/staging/404.html',
'tests/testFolder/staging/Power7.html',
'tests/testFolder/staging/bonesboundhome.html',
'tests/testFolder/staging/bonescallhome.html',
'tests/testFolder/staging/bonescrawlhome.html',
'tests/testFolder/staging/bonesrunhome.html',
'tests/testFolder/staging/bonesboundhome.html',
'tests/testFolder/staging/contact.html',
'tests/testFolder/staging/emacsFiles.html',
'tests/testFolder/staging/index.html',
'tests/testFolder/staging/myRack.html',
'tests/testFolder/staging/report.html',
'tests/testFolder/staging/template.html',
'tests/testFolder/staging/bonescallhome.html',
'tests/testFolder/staging/404.html',
'tests/testFolder/staging/emacsFiles.html',
'tests/testFolder/staging/Power7.html',
'tests/testFolder/staging/contact.html',
]),
])
list([
'tests/testFolder/sites/404.html',
'tests/testFolder/sites/Power7.html',
'tests/testFolder/sites/bonesboundhome.html',
'tests/testFolder/sites/bonescallhome.html',
'tests/testFolder/sites/bonescrawlhome.html',
'tests/testFolder/sites/bonesrunhome.html',
'tests/testFolder/sites/contact.html',
'tests/testFolder/sites/emacsFiles.html',
'tests/testFolder/sites/index.html',
'tests/testFolder/sites/myRack.html',
'tests/testFolder/sites/report.html',
'tests/testFolder/sites/template.html',
]),
)
# ---
# name: test_readfilesFile
tuple(
Expand Down
10 changes: 6 additions & 4 deletions tests/test_stuff.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,18 @@ def test_templates_output_infile(snapshot):
assert filecheck == snapshot

def test_readfilesDir(snapshot):
listFiles = sorted(ssri.getListOfFilesToSearchDir("tests/testFolder/staging", ["tests/testFolder/sites"], True, False ))
assert listFiles == snapshot
listFiles = ssri.getListOfFilesToSearchDir("tests/testFolder/staging", ["tests/testFolder/sites"], True, False )
listFilesSort = (sorted(listFiles[0]), sorted(listFiles[1]))
assert listFilesSort == snapshot

def test_readfilesFile(snapshot):
listFiles = ssri.getListOfFilesToSearchFiles(["tests/testFolder/staging/emacsFiles.html"], ["tests/testFolder/sites"], "tests/testFolder/templates", False, 0, False)
assert listFiles == snapshot

def test_lookForInclude(snapshot):
inputFiles = sorted(ssri.getListOfFilesToSearchDir("tests/testFolder/staging", ["tests/testFolder/sites"], True, False))
assert inputFiles == snapshot
inputFiles = ssri.getListOfFilesToSearchDir("tests/testFolder/staging", ["tests/testFolder/sites"], True, False)
inputFilesSort = (sorted(inputFiles[0]), sorted(inputFiles[1]))
assert inputFilesSort == snapshot


def test_checkCopyFiles(snapshot):
Expand Down

0 comments on commit fe97f32

Please sign in to comment.