<commit_before># CEBALERT: incomplete tests of Filename and associated code

## test not pickling normalize_ and resolve_paths's prefix/search_paths

>>> import tempfile
>>> import os
>>> import param
>>> import shutil
>>> from topo import command

>>> original_prefix = param.normalize_path.prefix
>>> original_search_paths = param.resolve_path.search_paths

>>> tmp1 = tempfile.mkdtemp()
>>> tmp2 = tempfile.mkdtemp()

>>> param.normalize_path.prefix = tmp1
>>> param.resolve_path.search_paths = [tmp1]

>>> command.save_snapshot('test.typ')

>>> param.normalize_path.prefix = tmp2
>>> param.resolve_path.search_paths = [tmp2]

>>> command.load_snapshot(os.path.join(tmp1,'test.typ'))
Time: 000001.00 TopoConsole00277: Applying legacy support for change r11871
>>> assert param.normalize_path.prefix==tmp2
>>> assert param.resolve_path.search_paths==[tmp2], "%s %s %s"%(tmp1,tmp2,param.resolve_path.search_paths)

# clean up
>>> param.normalize_path.prefix = original_prefix
>>> param.resolve_path.search_paths = original_search_paths
>>> shutil.rmtree(tmp1)
>>> shutil.rmtree(tmp2)

## end test of not pickling prefix, search_paths

>>> tmp3 = tempfile.mkdtemp()
>>> open("%s/testing"%tmp3,'w').close()


>>> class TestFileName(param.Parameterized):
...    filename = param.Filename(default="testing",search_paths=[tmp3])

>>> c = TestFileName()
>>> os.path.normpath(c.filename) == os.path.normpath("%s/testing"%tmp3)
True

>>> shutil.rmtree(tmp3)
<commit_msg>Revert accidental change to /topo/test/testFilename.txt in last commit.<commit_after># CEBALERT: incomplete tests of Filename and associated code

## test not pickling normalize_ and resolve_paths's prefix/search_paths

>>> import tempfile
>>> import os
>>> import param
>>> import shutil
>>> from topo import command

>>> original_prefix = param.normalize_path.prefix
>>> original_search_paths = param.resolve_path.search_paths

>>> tmp1 = tempfile.mkdtemp()
>>> tmp2 = tempfile.mkdtemp()

>>> param.normalize_path.prefix = tmp1
>>> param.resolve_path.search_paths = [tmp1]

>>> command.save_snapshot('test.typ')

>>> param.normalize_path.prefix = tmp2
>>> param.resolve_path.search_paths = [tmp2]

>>> command.load_snapshot(os.path.join(tmp1,'test.typ'))
>>> assert param.normalize_path.prefix==tmp2
>>> assert param.resolve_path.search_paths==[tmp2], "%s %s %s"%(tmp1,tmp2,param.resolve_path.search_paths)

# clean up
>>> param.normalize_path.prefix = original_prefix
>>> param.resolve_path.search_paths = original_search_paths
>>> shutil.rmtree(tmp1)
>>> shutil.rmtree(tmp2)

## end test of not pickling prefix, search_paths

>>> tmp3 = tempfile.mkdtemp()
>>> open("%s/testing"%tmp3,'w').close()


>>> class TestFileName(param.Parameterized):
...    filename = param.Filename(default="testing",search_paths=[tmp3])

>>> c = TestFileName()
>>> os.path.normpath(c.filename) == os.path.normpath("%s/testing"%tmp3)
True

>>> shutil.rmtree(tmp3)

{'fraction_non_alphanumeric': 0.16299862448418156, 'fraction_numerical': 0.018569463548830812, 'mean_word_length': 6.1474201474201475, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 165, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '93901', 'n_tokens_mistral': 976, 'n_tokens_neox': 959, 'n_words': 178}