def test_str(self): a = Archive(self.default_name) self.assertEquals(str(a), 'archive_name (0 undefined archives)') a.archives = range(10) a.medkits = range(5) self.assertEquals( str(a), 'archive_name (10 undefined archives, 5 par2 files)')
def test_str(self): a = Archive(self.default_name) self.assertEquals(str(a), 'archive_name (0 undefined ' \ 'archives, 0 par2 files)') a.archives = range(10) a.medkits = range(5) self.assertEquals(str(a), 'archive_name (10 undefined ' \ 'archives, 5 par2 files)')
def test_remove(self): system_commands = [] def fake_system(cmd): system_commands.append(cmd) original_system = os.system os.system = fake_system a = Archive(self.default_name) a.medkits = ['toto', 'titi'] a.archives = ['tata', 'tutu'] a.remove() self.assertEquals(system_commands, ['rm -f ./tata ./tutu ./toto ./titi']) os.system = original_system
def test_files(self): a = Archive(self.default_name) self.assertEquals(len(a.files), 0) a.medkits = ['toto', 'titi'] a.archives = ['tata', 'tutu'] self.assertEquals(len(a.files), 4)