Exemplo n.º 1
0
 def test_show_space_list(self):
     capturedOutput = StringIO.StringIO()
     sys.stdout = capturedOutput
     show_space_list(args.directory,
                     args.depth,
                     order=(args.order == 'desc'))
     sys.stdout = sys.__stdout__
     self.assertIn('Size (%) File' and self.path,
                   capturedOutput.getvalue().strip())
Exemplo n.º 2
0
    def test_show_space_list(self):
        cap = StringIO.StringIO()
        sys.stdout = cap

        show_space_list(self.path)
        top = "   Size   (%)  File\n"
        path = "/home/mateus/Tec_Prog/05--Mateusas3s/teste"
        file = "10.00Kb  100%  " + path + "\n"
        in_file_1 = " 4.00Kb   40%  " + path + "/teste_2\n"
        in_file_2 = " 4.00Kb   40%  " + path + "/teste_1\n"
        result = top + file + in_file_1 + in_file_2
        sys.stdout = sys.__stdout__
        self.assertEqual(result, cap.getvalue())
Exemplo n.º 3
0
 def test_show_space_list(self):
     self.assertIsNone(show_space_list(directory='.', depth=-1, order=True))
Exemplo n.º 4
0
 def test_show_space_list(self):
     self.assertIsNone(show_space_list())
 def test_show_space_list(self):
    self.assertIsNone(show_space_list(directory = '.', depth = 0, order=True))
    result = unittest.TestLoader().loadTestsFromTestCase(TestDiskspace)
    unittest.TextTestRunner(verbosity = 2).run(suite)