def test_timeout(self):
     self.expected.update(dict(
         timeout='10'))
     client.main(['--timeout', self.expected.get('timeout')])
     self.expected.update(dict(
         timeout='15'))
     client.main(['-t', self.expected.get('timeout')])
Ejemplo n.º 2
0
 def test_timeout(self):
     self.expected.update(dict(
         timeout='10'))
     client.main(['--timeout', self.expected.get('timeout')])
     self.expected.update(dict(
         timeout='15'))
     client.main(['-t', self.expected.get('timeout')])
Ejemplo n.º 3
0
 def test_mixed_order(self):
     self.expected.update(
         dict(args=['1', '2', '3'],
              timeout='20',
              socket_url='mixed_socket_url'))
     client.main(
         ['-t', self.expected.get('timeout')] +
         ['--socket-url', self.expected.get('socket_url')] +
         self.expected.get('args'))
     client.main(
         ['-t', self.expected.get('timeout')] + self.expected.get('args') +
         ['--socket-url', self.expected.get('socket_url')])
     client.main(
         self.expected.get('args') +
         ['-t', self.expected.get('timeout')] +
         ['--socket-url', self.expected.get('socket_url')])
 def test_mixed_order(self):
     self.expected.update(dict(
         args=['1', '2', '3'],
         timeout='20',
         socket_url='mixed_socket_url'))
     client.main(
         ['-t', self.expected.get('timeout')] +
         ['--socket-url', self.expected.get('socket_url')] +
         self.expected.get('args'))
     client.main(
         ['-t', self.expected.get('timeout')] +
         self.expected.get('args') +
         ['--socket-url', self.expected.get('socket_url')])
     client.main(
         self.expected.get('args') +
         ['-t', self.expected.get('timeout')] +
         ['--socket-url', self.expected.get('socket_url')])
 def run(args, expected):
     output = StringIO()
     sys.stdout = output
     client.main(args)
     self.assertEqual(output.getvalue(), expected)
 def test_json_arg_prefix(self):
     args = ['_1', '@1']
     expected_args = [1, '@1']
     self.expected.update(dict(
         args=expected_args))
     client.main(args + ['--json-arg-prefix', '_'])
 def test_json_args(self):
     args = ['@1', '@[1,2,3]', '@{"key":"value"}']
     expected_args = [1, [1, 2, 3], {'key': 'value'}]
     self.expected.update(dict(
         args=expected_args))
     client.main(args)
 def test_args(self):
     self.expected.update(dict(
         args=['1', '2', '3']))
     client.main(self.expected.get('args'))
 def test_socket_url_env(self):
     expected_socket_url = 'env_sock_url'
     os.environ['CTX_SOCKET_URL'] = expected_socket_url
     self.expected.update(dict(
         socket_url=expected_socket_url))
     client.main([])
Ejemplo n.º 10
0
 def test_socket_url_arg(self):
     self.expected.update(dict(
         socket_url='sock_url'))
     client.main(['--socket-url', self.expected.get('socket_url')])
Ejemplo n.º 11
0
 def run(args, expected):
     output = StringIO()
     sys.stdout = output
     client.main(args)
     self.assertEqual(output.getvalue(), expected)
Ejemplo n.º 12
0
 def test_json_arg_prefix(self):
     args = ['_1', '@1']
     expected_args = [1, '@1']
     self.expected.update(dict(args=expected_args))
     client.main(args + ['--json-arg-prefix', '_'])
Ejemplo n.º 13
0
 def test_json_args(self):
     args = ['@1', '@[1,2,3]', '@{"key":"value"}']
     expected_args = [1, [1, 2, 3], {'key': 'value'}]
     self.expected.update(dict(args=expected_args))
     client.main(args)
Ejemplo n.º 14
0
 def test_args(self):
     self.expected.update(dict(args=['1', '2', '3']))
     client.main(self.expected.get('args'))
Ejemplo n.º 15
0
 def test_socket_url_env(self):
     expected_socket_url = 'env_sock_url'
     os.environ['CTX_SOCKET_URL'] = expected_socket_url
     self.expected.update(dict(socket_url=expected_socket_url))
     client.main([])
Ejemplo n.º 16
0
 def test_socket_url_arg(self):
     self.expected.update(dict(socket_url='sock_url'))
     client.main(['--socket-url', self.expected.get('socket_url')])