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