File: options_test.py

package info (click to toggle)
python-tornado 2.3-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,536 kB
  • sloc: python: 12,755; ansic: 64; xml: 26; sql: 25; makefile: 17
file content (19 lines) | stat: -rw-r--r-- 562 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from __future__ import absolute_import, division, with_statement
import unittest

from tornado.options import _Options


class OptionsTest(unittest.TestCase):
    def setUp(self):
        self.options = _Options()
        define = self.options.define
        # these are currently required
        define("logging", default="none")
        define("help", default=False)

        define("port", default=80)

    def test_parse_command_line(self):
        self.options.parse_command_line(["main.py", "--port=443"])
        self.assertEqual(self.options.port, 443)