Example #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
Example #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
Example #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"
Example #4
0
 def test_get_cwd_no_option(self):
     options = argparse.Namespace(cwd=None)
     assert main.get_cwd(options) is None
Example #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"
Example #6
0
 def test_get_cwd_no_option(self):
     options = argparse.Namespace(cwd=None)
     assert main.get_cwd(options) is None