Пример #1
0
    def test_dest_exists(self):
        self.create(self.bar, b'bar contents')
        fancy_rename(self.foo, self.bar)
        self.assertFalse(os.path.exists(self.foo))

        with open(self.bar, 'rb') as new_f:
            self.assertEqual(b'foo contents', new_f.read())
Пример #2
0
    def test_dest_exists(self):
        self.create(self.bar, b'bar contents')
        fancy_rename(self.foo, self.bar)
        self.assertFalse(os.path.exists(self.foo))

        new_f = open(self.bar, 'rb')
        self.assertEqual(b'foo contents', new_f.read())
        new_f.close()
Пример #3
0
    def test_dest_exists(self):
        self.create(self.bar, 'bar contents')
        fancy_rename(self.foo, self.bar)
        self.assertFalse(os.path.exists(self.foo))

        new_f = open(self.bar, 'rb')
        self.assertEqual('foo contents', new_f.read())
        new_f.close()
Пример #4
0
    def test_dest_exists(self):
        self.create(self.bar, b"bar contents")
        fancy_rename(self.foo, self.bar)
        self.assertFalse(os.path.exists(self.foo))

        new_f = open(self.bar, "rb")
        self.assertEqual(b"foo contents", new_f.read())
        new_f.close()