orphan disk search update

This commit is contained in:
David Schroeder
2026-09-22 22:28:41 -05:00
parent 3ecc338466
commit e34f9d832e
4 changed files with 19 additions and 17 deletions
+7 -6
View File
@@ -82,12 +82,13 @@ class ReportTests(unittest.TestCase):
self.assertEqual(len(coverage), 3)
self.assertNotIn('/nodes/b/storage/shared/content', calls)
def test_csv_preserves_warnings_and_refuses_overwrite(self):
def test_csv_omits_warnings_and_refuses_overwrite(self):
path = self.root / 'report.csv'
disks.export_csv(path, [], ['node offline'])
self.assertIn('node offline', path.read_text())
disks.export_csv(path, [])
self.assertNotIn('coverage_warnings', path.read_text())
self.assertEqual(len(path.read_text().splitlines()), 1)
with self.assertRaises(FileExistsError):
disks.export_csv(path, [], [])
disks.export_csv(path, [])
def test_disk_sizes_in_display_and_csv(self):
for index, (size, expected) in enumerate([
@@ -103,7 +104,7 @@ class ReportTests(unittest.TestCase):
disks.render([row], [], [])
self.assertIn('Disk size: ' + expected, output.getvalue())
path = self.root / f'sizes-{index}.csv'
disks.export_csv(path, [row], [])
disks.export_csv(path, [row])
with path.open(newline='') as handle:
exported = next(csv.DictReader(handle))
self.assertEqual(exported['disk_size'], expected)
@@ -135,7 +136,7 @@ class ReportTests(unittest.TestCase):
disks.render(rows, warnings, coverage)
self.assertIn('Disk size: ~25.91 GiB', output.getvalue())
path = self.root / 'approximate.csv'
disks.export_csv(path, rows, warnings)
disks.export_csv(path, rows)
with path.open(newline='') as handle:
exported = list(csv.DictReader(handle))
self.assertEqual([row['disk_size'] for row in exported],