def test_remove(self):
        system_commands = []

        def fake_system(cmd):
            system_commands.append(cmd)

        original_system = os.system
        os.system = fake_system

        dirpath = './tests/data/medkits'
        mk = MedKit('test_PAR2', dirpath, os.listdir(dirpath))
        mk.remove()

        self.assertEquals(system_commands,
                          ['rm -f ./tests/data/medkits/test_PAR2.txt.par2 '
                           './tests/data/medkits/test_PAR2.txt.vol0+1.par2'])
        os.system = original_system
Exemple #2
0
    def test_remove(self):
        system_commands = []

        def fake_system(cmd):
            system_commands.append(cmd)

        original_system = os.system
        os.system = fake_system

        dirpath = './tests/data/medkits'
        mk = MedKit('test_PAR2', dirpath, os.listdir(dirpath))
        mk.remove()

        self.assertEquals(system_commands, [
            'rm -f ./tests/data/medkits/test_PAR2.txt.par2 '
            './tests/data/medkits/test_PAR2.txt.vol0+1.par2'
        ])
        os.system = original_system