Ejemplo n.º 1
0
 def test_get_cwd_nonexistent(self):
     options = argparse.Namespace(cwd="unlikely_to_exist")
     with patch('os.path.exists', return_value=False):
         try:
             main.get_cwd(options)
         except exceptions.InvalidCwd:
             pass
Ejemplo n.º 2
0
 def test_get_cwd_nonexistent(self):
     options = argparse.Namespace(cwd="unlikely_to_exist")
     with patch('os.path.exists', return_value=False):
         try:
             main.get_cwd(options)
         except exceptions.InvalidCwd:
             pass
Ejemplo n.º 3
0
 def test_get_cwd(self):
     options = argparse.Namespace(cwd="foo")
     with patch('os.path.exists', return_value=True):
         cwd = main.get_cwd(options)
     assert cwd == "foo"
Ejemplo n.º 4
0
 def test_get_cwd_no_option(self):
     options = argparse.Namespace(cwd=None)
     assert main.get_cwd(options) is None
Ejemplo n.º 5
0
 def test_get_cwd(self):
     options = argparse.Namespace(cwd="foo")
     with patch('os.path.exists', return_value=True):
         cwd = main.get_cwd(options)
     assert cwd == "foo"
Ejemplo n.º 6
0
 def test_get_cwd_no_option(self):
     options = argparse.Namespace(cwd=None)
     assert main.get_cwd(options) is None