コード例 #1
0
 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)')
コード例 #2
0
ファイル: test_archive.py プロジェクト: macobo/easy-extract
 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)')
コード例 #3
0
    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
コード例 #4
0
    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
コード例 #5
0
 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)
コード例 #6
0
 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)