Пример #1
0
 def test_cwd(self):
     old_cwd_expected = os.getcwd()
     with shell.cwd(self.data_dir_path) as old_path:
         self.assertTrue(os.path.isfile(self.ifconfig_out_name))
         self.assertEquals(old_path, old_cwd_expected)
     self.assertEquals(os.getcwd(), old_cwd_expected)
Пример #2
0
 def cwd_wrong_arg():
     with shell.cwd('does not exist be9adc02'):
         pass
Пример #3
0
 def test_cwd_wrong_arg(self):
     with self.assertRaises(OSError):
         with shell.cwd('does not exist be9adc02'):
             pass
Пример #4
0
 def test_cwd(self):
     old_cwd_expected = os.getcwd()
     with shell.cwd(self.data_dir_path) as old_path:
         self.assertTrue(os.path.isfile(self.ifconfig_out_name));
         self.assertEquals(old_path, old_cwd_expected)
     self.assertEquals(os.getcwd(), old_cwd_expected)
Пример #5
0
 def cwd_wrong_arg():
     with shell.cwd('does not exist be9adc02'):
         pass