Exemplo n.º 1
0
 def test_shell_options(self):
     vexrc = Vexrc()
     vexrc[vexrc.default_heading]['shell'] = '/bin/dish'
     options = Object(rest=['given', 'command'])
     environ = {'SHELL': 'wrong'}
     assert main.get_command(options, vexrc,
                             environ) == ['given', 'command']
Exemplo n.º 2
0
 def test_shell_vexrc(self):
     vexrc = Vexrc()
     vexrc[vexrc.default_heading]['shell'] = '/bin/dish'
     options = Object(rest=None)
     environ = {'SHELL': 'wrong'}
     assert main.get_command(options, vexrc, environ) == ['/bin/dish']
Exemplo n.º 3
0
 def test_flag(self):
     vexrc = Vexrc()
     options = argparse.Namespace(rest=['--foo'])
     environ = {}
     with raises(exceptions.InvalidCommand):
         main.get_command(options, vexrc, environ)
Exemplo n.º 4
0
 def test_nothing(self):
     vexrc = Vexrc()
     options = argparse.Namespace(rest=None)
     environ = {}
     with raises(exceptions.InvalidCommand):
         main.get_command(options, vexrc, environ)
Exemplo n.º 5
0
 def test_shell_environ(self):
     vexrc = Vexrc()
     options = Object(rest=None)
     environ = {'SHELL': '/bin/dish'}
     assert main.get_command(options, vexrc, environ) == ['/bin/dish']
Exemplo n.º 6
0
 def test_flag(self):
     vexrc = Vexrc()
     options = argparse.Namespace(rest=['--foo'])
     environ = {}
     with raises(exceptions.InvalidCommand):
         main.get_command(options, vexrc, environ)
Exemplo n.º 7
0
 def test_nothing(self):
     vexrc = Vexrc()
     options = argparse.Namespace(rest=None)
     environ = {}
     with raises(exceptions.InvalidCommand):
         main.get_command(options, vexrc, environ)
Exemplo n.º 8
0
 def test_shell_environ(self):
     vexrc = Vexrc()
     options = Object(rest=None)
     environ = {'SHELL': '/bin/dish'}
     assert main.get_command(options, vexrc, environ) == ['/bin/dish']
Exemplo n.º 9
0
 def test_shell_vexrc(self):
     vexrc = Vexrc()
     vexrc[vexrc.default_heading]["shell"] = "/bin/dish"
     options = Object(rest=None)
     environ = {"SHELL": "wrong"}
     assert main.get_command(options, vexrc, environ) == ["/bin/dish"]
Exemplo n.º 10
0
 def test_shell_environ(self):
     vexrc = Vexrc()
     options = Object(rest=None)
     environ = {"SHELL": "/bin/dish"}
     assert main.get_command(options, vexrc, environ) == ["/bin/dish"]