def test_cp_nonexistant(self): "Should raise" with self.assertRaises(exceptions.DoesNotExistError): p = Path('does/not/exist/here') p.cp('will/not/exist/there')
def test_cp_file(self): "Copy self to dest" p = Path(self.tdir) + 'some.txt' p << 'contents' p.cp(p.parent + 'some2.txt') self.assertTrue(filecmp.cmp(p, p.parent + 'some2.txt'))