Fix dropdown showing 'Global' interval #29
2 changed files with 4 additions and 1 deletions
|
@ -175,7 +175,7 @@ def _generate_root_index() -> None:
|
|||
intervals = [
|
||||
p.name
|
||||
for p in OUTPUT_DIR.iterdir()
|
||||
if p.is_dir() and p.name not in {"domains", "global"}
|
||||
if p.is_dir() and p.name.lower() not in {"domains", "global"}
|
||||
]
|
||||
intervals.sort()
|
||||
|
||||
|
|
|
@ -182,6 +182,8 @@ def test_generate_root_index(tmp_path, sample_reports, monkeypatch):
|
|||
# create dummy domain directories
|
||||
(tmp_path / "output" / "domains" / "foo.com").mkdir(parents=True)
|
||||
(tmp_path / "output" / "domains" / "bar.com").mkdir(parents=True)
|
||||
# add an extra directory with capitalized name to ensure it's ignored
|
||||
(tmp_path / "output" / "Global").mkdir(parents=True)
|
||||
|
||||
gr._generate_root_index()
|
||||
|
||||
|
@ -193,6 +195,7 @@ def test_generate_root_index(tmp_path, sample_reports, monkeypatch):
|
|||
assert '<option value="hourly">' in content
|
||||
assert '<option value="daily">' in content
|
||||
assert '<option value="global">' not in content
|
||||
assert '<option value="Global">' not in content
|
||||
|
||||
# check for domain options
|
||||
assert '<option value="foo.com">' in content
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue