def test_read_dir(self): "Reading a directory should raise" p = Path(self.tdir) with self.assertRaises(TypeError): p.read()
def test_read(self): "Should read the path" nopath = tempfile.mkdtemp() p = Path(nopath) + 'myfile.txt' p << 'Contentz' self.assertEqual('Contentz', p.read())