Ejemplo n.º 1
0
 def test_basic(self):
     fixture = TempHomeDir()
     sentinel = object()
     self.assertEqual(sentinel, getattr(fixture, 'path', sentinel))
     fixture.setUp()
     try:
         path = fixture.path
         self.assertTrue(os.path.isdir(path))
         self.assertEqual(path, os.environ.get("HOME"))
     finally:
         fixture.cleanUp()
         self.assertFalse(os.path.isdir(path))
Ejemplo n.º 2
0
 def test_basic(self):
     fixture = TempHomeDir()
     sentinel = object()
     self.assertEqual(sentinel, getattr(fixture, 'path', sentinel))
     fixture.setUp()
     try:
         path = fixture.path
         self.assertTrue(os.path.isdir(path))
         self.assertEqual(path, os.environ.get("HOME"))
     finally:
         fixture.cleanUp()
         self.assertFalse(os.path.isdir(path))
Ejemplo n.º 3
0
 def test_under_dir(self):
     root = self.useFixture(TempDir()).path
     fixture = TempHomeDir(root)
     fixture.setUp()
     with fixture:
         self.assertThat(fixture.path, StartsWith(root))
Ejemplo n.º 4
0
 def test_under_dir(self):
     root = self.useFixture(TempDir()).path
     fixture = TempHomeDir(root)
     fixture.setUp()
     with fixture:
         self.assertThat(fixture.path, StartsWith(root))