|
4 | 4 | def test_trie():
|
5 | 5 | trie_root = Trie("default", {"line_length": 70})
|
6 | 6 |
|
7 |
| - trie_root._insert("/temp/config1/.isort.cfg", {"line_length": 71}) |
8 |
| - trie_root._insert("/temp/config2/setup.cfg", {"line_length": 72}) |
9 |
| - trie_root._insert("/temp/config3/pyproject.toml", {"line_length": 73}) |
| 7 | + trie_root.insert("/temp/config1/.isort.cfg", {"line_length": 71}) |
| 8 | + trie_root.insert("/temp/config2/setup.cfg", {"line_length": 72}) |
| 9 | + trie_root.insert("/temp/config3/pyproject.toml", {"line_length": 73}) |
10 | 10 |
|
11 | 11 | # Ensure that appropriate configs are resolved for files in different directories
|
12 |
| - config1 = trie_root._search("/temp/config1/subdir/file1.py") |
| 12 | + config1 = trie_root.search("/temp/config1/subdir/file1.py") |
13 | 13 | assert config1[0] == "/temp/config1/.isort.cfg"
|
14 | 14 | assert config1[1] == {"line_length": 71}
|
15 | 15 |
|
16 |
| - config1_2 = trie_root._search("/temp/config1/file1_2.py") |
| 16 | + config1_2 = trie_root.search("/temp/config1/file1_2.py") |
17 | 17 | assert config1_2[0] == "/temp/config1/.isort.cfg"
|
18 | 18 | assert config1_2[1] == {"line_length": 71}
|
19 | 19 |
|
20 |
| - config2 = trie_root._search("/temp/config2/subdir/subsubdir/file2.py") |
| 20 | + config2 = trie_root.search("/temp/config2/subdir/subsubdir/file2.py") |
21 | 21 | assert config2[0] == "/temp/config2/setup.cfg"
|
22 | 22 | assert config2[1] == {"line_length": 72}
|
23 | 23 |
|
24 |
| - config2_2 = trie_root._search("/temp/config2/subdir/file2_2.py") |
| 24 | + config2_2 = trie_root.search("/temp/config2/subdir/file2_2.py") |
25 | 25 | assert config2_2[0] == "/temp/config2/setup.cfg"
|
26 | 26 | assert config2_2[1] == {"line_length": 72}
|
27 | 27 |
|
28 |
| - config3 = trie_root._search("/temp/config3/subdir/subsubdir/subsubsubdir/file3.py") |
| 28 | + config3 = trie_root.search("/temp/config3/subdir/subsubdir/subsubsubdir/file3.py") |
29 | 29 | assert config3[0] == "/temp/config3/pyproject.toml"
|
30 | 30 | assert config3[1] == {"line_length": 73}
|
31 | 31 |
|
32 |
| - config3_2 = trie_root._search("/temp/config3/file3.py") |
| 32 | + config3_2 = trie_root.search("/temp/config3/file3.py") |
33 | 33 | assert config3_2[0] == "/temp/config3/pyproject.toml"
|
34 | 34 | assert config3_2[1] == {"line_length": 73}
|
35 | 35 |
|
36 |
| - config_outside = trie_root._search("/temp/file.py") |
| 36 | + config_outside = trie_root.search("/temp/file.py") |
37 | 37 | assert config_outside[0] == "default"
|
38 | 38 | assert config_outside[1] == {"line_length": 70}
|
0 commit comments