@@ 685-696 (lines=12) @@ | ||
682 | ||
683 | assert path == 'CA', path |
|
684 | ||
685 | def test_parse_folder_name_multiple_keys_not_found(): |
|
686 | if hasattr(load_config, 'config'): |
|
687 | del load_config.config |
|
688 | filesystem = FileSystem() |
|
689 | place_name = {'default': u'US', 'country': u'US'} |
|
690 | mask = '%city-%state' |
|
691 | location_parts = re.findall('(%[^%]+)', mask) |
|
692 | path = filesystem.parse_mask_for_location(mask, location_parts, place_name) |
|
693 | if hasattr(load_config, 'config'): |
|
694 | del load_config.config |
|
695 | ||
696 | assert path == 'US', path |
|
697 | ||
698 | def test_process_file_invalid(): |
|
699 | filesystem = FileSystem() |
|
@@ 672-683 (lines=12) @@ | ||
669 | ||
670 | assert path == 'CA', path |
|
671 | ||
672 | def test_parse_folder_name_key_not_found_with_static_chars(): |
|
673 | if hasattr(load_config, 'config'): |
|
674 | del load_config.config |
|
675 | filesystem = FileSystem() |
|
676 | place_name = {'default': u'CA', 'country': u'US', 'state': u'CA'} |
|
677 | mask = '%city-is-not-found' |
|
678 | location_parts = re.findall('(%[^%]+)', mask) |
|
679 | path = filesystem.parse_mask_for_location(mask, location_parts, place_name) |
|
680 | if hasattr(load_config, 'config'): |
|
681 | del load_config.config |
|
682 | ||
683 | assert path == 'CA', path |
|
684 | ||
685 | def test_parse_folder_name_multiple_keys_not_found(): |
|
686 | if hasattr(load_config, 'config'): |
|
@@ 659-670 (lines=12) @@ | ||
656 | ||
657 | assert path == 'Sunnyvale-is-the-city', path |
|
658 | ||
659 | def test_parse_folder_name_key_not_found(): |
|
660 | if hasattr(load_config, 'config'): |
|
661 | del load_config.config |
|
662 | filesystem = FileSystem() |
|
663 | place_name = {'default': u'CA', 'country': u'US', 'state': u'CA'} |
|
664 | mask = '%city' |
|
665 | location_parts = re.findall('(%[^%]+)', mask) |
|
666 | path = filesystem.parse_mask_for_location(mask, location_parts, place_name) |
|
667 | if hasattr(load_config, 'config'): |
|
668 | del load_config.config |
|
669 | ||
670 | assert path == 'CA', path |
|
671 | ||
672 | def test_parse_folder_name_key_not_found_with_static_chars(): |
|
673 | if hasattr(load_config, 'config'): |
|
@@ 646-657 (lines=12) @@ | ||
643 | ||
644 | assert path == 'Sunnyvale-CA-US', path |
|
645 | ||
646 | def test_parse_folder_name_static_chars(): |
|
647 | if hasattr(load_config, 'config'): |
|
648 | del load_config.config |
|
649 | filesystem = FileSystem() |
|
650 | place_name = {'default': u'CA', 'country': u'US', 'state': u'CA', 'city': u'Sunnyvale'} |
|
651 | mask = '%city-is-the-city' |
|
652 | location_parts = re.findall('(%[^%]+)', mask) |
|
653 | path = filesystem.parse_mask_for_location(mask, location_parts, place_name) |
|
654 | if hasattr(load_config, 'config'): |
|
655 | del load_config.config |
|
656 | ||
657 | assert path == 'Sunnyvale-is-the-city', path |
|
658 | ||
659 | def test_parse_folder_name_key_not_found(): |
|
660 | if hasattr(load_config, 'config'): |
|
@@ 633-644 (lines=12) @@ | ||
630 | ||
631 | assert path == 'Sunnyvale', path |
|
632 | ||
633 | def test_parse_folder_name_multiple(): |
|
634 | if hasattr(load_config, 'config'): |
|
635 | del load_config.config |
|
636 | filesystem = FileSystem() |
|
637 | place_name = {'default': u'CA', 'country': u'US', 'state': u'CA', 'city': u'Sunnyvale'} |
|
638 | mask = '%city-%state-%country' |
|
639 | location_parts = re.findall('(%[^%]+)', mask) |
|
640 | path = filesystem.parse_mask_for_location(mask, location_parts, place_name) |
|
641 | if hasattr(load_config, 'config'): |
|
642 | del load_config.config |
|
643 | ||
644 | assert path == 'Sunnyvale-CA-US', path |
|
645 | ||
646 | def test_parse_folder_name_static_chars(): |
|
647 | if hasattr(load_config, 'config'): |
|
@@ 620-631 (lines=12) @@ | ||
617 | ||
618 | assert path == os.path.join('2015-12-Dec','Sunnyvale'), path |
|
619 | ||
620 | def test_parse_folder_name_default(): |
|
621 | if hasattr(load_config, 'config'): |
|
622 | del load_config.config |
|
623 | filesystem = FileSystem() |
|
624 | place_name = {'default': u'CA', 'country': u'US', 'state': u'CA', 'city': u'Sunnyvale'} |
|
625 | mask = '%city' |
|
626 | location_parts = re.findall('(%[^%]+)', mask) |
|
627 | path = filesystem.parse_mask_for_location(mask, location_parts, place_name) |
|
628 | if hasattr(load_config, 'config'): |
|
629 | del load_config.config |
|
630 | ||
631 | assert path == 'Sunnyvale', path |
|
632 | ||
633 | def test_parse_folder_name_multiple(): |
|
634 | if hasattr(load_config, 'config'): |