def test_filter_members_no_prefix(): members = _filter_members( [ ZipInfo("__MACOSX/foo"), ZipInfo("submi1ssion/submission.csv"), ZipInfo("submi2ssion/__MACOSX/bar"), ZipInfo("baz/.DS_Store"), ZipInfo("submi3ssion/images/image10x10x10.mhd"), ZipInfo("submission/images/image10x10x10.zraw"), ] ) assert members == [ { "src": "submi1ssion/submission.csv", "dest": "submi1ssion/submission.csv", }, { "src": "submi3ssion/images/image10x10x10.mhd", "dest": "submi3ssion/images/image10x10x10.mhd", }, { "src": "submission/images/image10x10x10.zraw", "dest": "submission/images/image10x10x10.zraw", }, ]
def test_filter_members_single_file_nested(): members = _filter_members([ZipInfo("foo/bar")]) assert members == [{"src": "foo/bar", "dest": "bar"}]
def test_filter_members_single_file(): members = _filter_members([ZipInfo("foo")]) assert members == [{"src": "foo", "dest": "foo"}]