Ejemplo n.º 1
0
    def test_remove(self):
        system_commands = []

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

        original_system = os.system
        os.system = fake_system

        bfc = BaseFileCollection(self.default_name, '/path')
        bfc.filenames = ['toto.ext', 'titi.ext']
        bfc.remove()

        self.assertEquals(system_commands,
                          ['rm -f /path/toto.ext /path/titi.ext'])
        os.system = original_system
Ejemplo n.º 2
0
    def test_remove(self):
        system_commands = []

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

        original_system = os.system
        os.system = fake_system

        bfc = BaseFileCollection(self.default_name, '/path')
        bfc.filenames = ['toto.ext', 'titi.ext']
        bfc.remove()

        self.assertEquals(system_commands,
                          ['rm -f /path/toto.ext /path/titi.ext'])
        os.system = original_system
Ejemplo n.º 3
0
 def test_files(self):
     bfc = BaseFileCollection(self.default_name)
     self.assertEquals(len(bfc.files), 0)
     bfc.filenames = ['toto', 'titi']
     self.assertEquals(len(bfc.files), 2)
Ejemplo n.º 4
0
 def test_files(self):
     bfc = BaseFileCollection(self.default_name)
     self.assertEquals(len(bfc.files), 0)
     bfc.filenames = ['toto', 'titi']
     self.assertEquals(len(bfc.files), 2)