def parses_with_long_args(self): options = create_options_from_arguments([ '--port=1234', '--address=other.server', '--text-protocol' ]) self.assertEqual(options.port, 1234) self.assertEqual(options.address, 'other.server') self.assertTrue(options.is_text_protocol)
def parses_with_short_args(self): options = create_options_from_arguments([ '-p', '1234', '-a', 'other.server', '-t' ]) self.assertEqual(options.port, 1234) self.assertEqual(options.address, 'other.server') self.assertTrue(options.is_text_protocol)
def parses_with_long_args(self): options = create_options_from_arguments( ['--port=1234', '--address=other.server', '--text-protocol']) self.assertEqual(options.port, 1234) self.assertEqual(options.address, 'other.server') self.assertTrue(options.is_text_protocol)
def parses_with_short_args(self): options = create_options_from_arguments( ['-p', '1234', '-a', 'other.server', '-t']) self.assertEqual(options.port, 1234) self.assertEqual(options.address, 'other.server') self.assertTrue(options.is_text_protocol)
def parses_without_args(self): options = create_options_from_arguments([]) self.assertEqual(options.port, 22322) self.assertEqual(options.address, 'localhost') self.assertFalse(options.is_text_protocol)