def test_danger(self, _, __): """Test computations around `df` output at disk danger level and tweaked limits""" disk = Disk().value self.assertTrue(all(i in disk for i in ['\x1b[0;33m', '861', '1024']))
def test(self, _, __): """Test computations around `df` output at disk normal level""" disk = Disk().value self.assertTrue(all(i in disk for i in ['\x1b[0;32m', '61', '1024']))
def test_warning(self, _, __): """Test computations around `df` output at disk warning level""" disk = Disk().value self.assertTrue(all(i in disk for i in ['\x1b[0;33m', '661', '1024']))
def test_df_only(self, _, __): """Test computations around `df` output at disk regular level""" disk = Disk().value self.assertTrue( all(i in disk for i in [str(Colors.GREEN_NORMAL), '45.9', '298.6']))
def test_df_only_warning(self, _, __): """Test computations around `df` output at disk warning level""" disk = Disk().value self.assertTrue( all(i in disk for i in [str(Colors.YELLOW_NORMAL), '251.6', '298.6']))
def test_no_recognised_disks(self, _, __): """Test df failing to detect any valid file-systems""" self.assertEqual(Disk().value, 'Not detected')
def test_df_failing(self, _, __): """Test df call failing against the BusyBox implementation""" self.assertEqual(Disk().value, 'Not detected')
def test_btrfs_only_with_raid_configuration(self, _, __): """Test computations around `btrfs` outputs with a RAID-1 setup""" disk = Disk().value self.assertTrue( all(i in disk for i in [str(Colors.GREEN_NORMAL), '943.4', '4202.5']))
def test_df_and_btrfs(self, _, __): """Test computations around `df` and `btrfs` outputs""" disk = Disk().value self.assertTrue( all(i in disk for i in [str(Colors.GREEN_NORMAL), '989.3', '4501.1']))
def test(self, _): """Test computations around `df` output""" self.assertIn('61', Disk().value) self.assertIn('1024', Disk().value)