|
5 | 5 |
|
6 | 6 | import copy |
7 | 7 | from io import StringIO |
| 8 | +import os |
8 | 9 | from os import path |
9 | 10 | import uuid |
10 | 11 | from urllib.request import \ |
|
21 | 22 | from webassets.version import Manifest, Version, VersionIndeterminableError |
22 | 23 |
|
23 | 24 | from .helpers import ( |
24 | | - TempEnvironmentHelper, assert_raises_regex) |
| 25 | + TempEnvironmentHelper, assert_raises_regex, normalize_paths) |
25 | 26 |
|
26 | 27 |
|
27 | 28 | class TestBundleConfig(TempEnvironmentHelper): |
@@ -403,9 +404,11 @@ def test_globbing(self): |
403 | 404 | # Returns all files, even duplicate relative filenames in |
404 | 405 | # multiple load paths (foo in this case). |
405 | 406 | bundle = self.mkbundle('*', output='out') |
406 | | - assert set(get_all_bundle_files(bundle)) == set([ |
| 407 | + result = get_all_bundle_files(bundle) |
| 408 | + expected = [ |
407 | 409 | self.path('a/foo'), self.path('b/foo'), self.path('b/bar') |
408 | | - ]) |
| 410 | + ] |
| 411 | + assert normalize_paths(result) == normalize_paths(expected) |
409 | 412 |
|
410 | 413 | def test_url_mapping(self): |
411 | 414 | """Test mapping the load paths to urls works.""" |
@@ -446,15 +449,19 @@ def test_globbed_load_path(self): |
446 | 449 |
|
447 | 450 | # With a non-globbed reference |
448 | 451 | bundle = self.mkbundle('foo', output='out') |
449 | | - assert set(get_all_bundle_files(bundle)) == set([ |
| 452 | + result = get_all_bundle_files(bundle) |
| 453 | + expected = [ |
450 | 454 | self.path('a/foo'), self.path('b/foo') |
451 | | - ]) |
| 455 | + ] |
| 456 | + assert normalize_paths(result) == normalize_paths(expected) |
452 | 457 |
|
453 | 458 | # With a globbed reference |
454 | 459 | bundle = self.mkbundle('???', output='out') |
455 | | - assert set(get_all_bundle_files(bundle)) == set([ |
| 460 | + result = get_all_bundle_files(bundle) |
| 461 | + expected = [ |
456 | 462 | self.path('a/foo'), self.path('b/foo'), self.path('dir/bar') |
457 | | - ]) |
| 463 | + ] |
| 464 | + assert normalize_paths(result) == normalize_paths(expected) |
458 | 465 |
|
459 | 466 |
|
460 | 467 | class TestGlobbing(TempEnvironmentHelper): |
@@ -620,6 +627,7 @@ def test_autorebuild_updaters(self): |
620 | 627 | bundle = self.mkbundle('http://foo', output='out') |
621 | 628 | TimestampUpdater().needs_rebuild(bundle, bundle.env) |
622 | 629 |
|
| 630 | + @pytest.mark.skipif(os.name == 'nt', reason="Colons not allowed in Windows filenames") |
623 | 631 | def test_pyramid_asset_specs(self): |
624 | 632 | """Make sure that pyramid asset specs (in the form of |
625 | 633 | package:path) do not pass the url check.""" |
|
0 commit comments