コード例 #1
0
ファイル: test_nix.py プロジェクト: pombredanne/ffs-1
 def test_as_fn(self):
     "Should work as a callable"
     nix.cd('/tmp')
     cwd = os.getcwd()
     if sys.platform == 'darwin':
         cwd = cwd.replace('/private', '')
     self.assertEqual('/tmp', cwd)
コード例 #2
0
ファイル: test_nix.py プロジェクト: pombredanne/ffs-1
 def test_accepts_path(self):
     "Should Duck-type with Path objects"
     nix.cd(Path('/tmp'))
     cwd = os.getcwd()
     if sys.platform == 'darwin':
         cwd = cwd.replace('/private', '')
     self.assertEqual('/tmp', cwd)
コード例 #3
0
ファイル: test_nix.py プロジェクト: davidmiller/ffs
 def test_accepts_path(self):
     "Should Duck-type with Path objects"
     nix.cd(Path('/tmp'))
     cwd = os.getcwd()
     if sys.platform == 'darwin':
         cwd = cwd.replace('/private', '')        
     self.assertEqual('/tmp', cwd)
コード例 #4
0
ファイル: test_nix.py プロジェクト: davidmiller/ffs
 def test_as_fn(self):
     "Should work as a callable"
     nix.cd('/tmp')
     cwd = os.getcwd()
     if sys.platform == 'darwin':
         cwd = cwd.replace('/private', '')
     self.assertEqual('/tmp', cwd)
コード例 #5
0
ファイル: test_nix.py プロジェクト: pombredanne/ffs-1
 def test_contextmanager(self):
     "Should work as a contextmanager"
     with nix.cd('/tmp') as path:
         cwd = os.getcwd()
         if sys.platform == 'darwin':
             cwd = cwd.replace('/private', '')
         self.assertEqual('/tmp', cwd)
         self.assertIsInstance(path, Path)
         self.assertEqual('/tmp', path)
     self.assertEqual(self.startdir, os.getcwd())
コード例 #6
0
ファイル: test_nix.py プロジェクト: davidmiller/ffs
 def test_contextmanager(self):
     "Should work as a contextmanager"
     with nix.cd('/tmp') as path:
         cwd = os.getcwd()
         if sys.platform == 'darwin':
             cwd = cwd.replace('/private', '')
         self.assertEqual('/tmp', cwd)
         self.assertIsInstance(path, Path)
         self.assertEqual('/tmp', path)
     self.assertEqual(self.startdir, os.getcwd())
コード例 #7
0
ファイル: test_nix.py プロジェクト: pombredanne/ffs-1
 def test_contextmanager_raises(self):
     "Should propagate exceptions"
     with self.assertRaises(RuntimeError):
         with nix.cd('/tmp'):
             raise RuntimeError('!')
     self.assertEqual(self.startdir, os.getcwd())
コード例 #8
0
ファイル: filesystem.py プロジェクト: pombredanne/ffs-1
 def cd(self, target):
     return nix.cd(target)
コード例 #9
0
ファイル: test_nix.py プロジェクト: davidmiller/ffs
 def test_contextmanager_raises(self):
     "Should propagate exceptions"
     with self.assertRaises(RuntimeError):
         with nix.cd('/tmp'):
             raise RuntimeError('!')
     self.assertEqual(self.startdir, os.getcwd())