Пример #1
0
    def test_auditor_bz2_compress_file(self):
        test_data = 'foo'
        with open(self.source, 'w') as f:
            f.write(test_data)

        destination = auditor.bz2_compress_file(self.source)

        assert destination == self.destination
        assert os.path.exists(self.destination)
        assert not os.path.exists(self.source)
        with bz2.BZ2File(self.destination) as f:
            assert f.read().decode() == test_data
Пример #2
0
    def test_auditor_bz2_compress_file(self):
        test_data = 'foo'
        with open(self.source, 'w') as f:
            f.write(test_data)

        destination = auditor.bz2_compress_file(self.source)

        eq_(destination, self.destination)
        ok_(os.path.exists(self.destination))
        ok_(not os.path.exists(self.source))
        with bz2.BZ2File(self.destination) as f:
            eq_(f.read(), test_data)