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