예제 #1
0
 def test_encoding_arg(self):
     self.assertEqual(parse_args(['--encoding', 'ASCII']),
                      (('localhost', 8000), '.', {
                          'index_file': 'index.html',
                          'default_type': 'application/octet-stream',
                          'encoding': 'ASCII'
                      }))
예제 #2
0
 def test_default_type_arg(self):
     self.assertEqual(parse_args(['--default-type', 'text/plain']),
                      (('localhost', 8000), '.', {
                          'index_file': 'index.html',
                          'default_type': 'text/plain',
                          'encoding': 'utf-8'
                      }))
예제 #3
0
 def test_index_file_arg(self):
     self.assertEqual(parse_args(['--index-file', 'README']),
                      (('localhost', 8000), '.', {
                          'index_file': 'README',
                          'default_type': 'application/octet-stream',
                          'encoding': 'utf-8'
                      }))
예제 #4
0
 def test_port_arg(self):
     self.assertEqual(parse_args(['--port', '80']),
                      (('localhost', 80), '.', {
                          'index_file': 'index.html',
                          'default_type': 'application/octet-stream',
                          'encoding': 'utf-8'
                      }))
예제 #5
0
 def test_root_arg(self):
     self.assertEqual(parse_args(['some/path/']),
                      (('localhost', 8000), 'some/path/', {
                          'index_file': 'index.html',
                          'default_type': 'application/octet-stream',
                          'encoding': 'utf-8'
                      }))
예제 #6
0
 def test_default_extension_arg(self):
     self.assertEqual(parse_args(['--default-extension', '.html']),
                      (('localhost', 8000), '.', {
                          'index_file': 'index.html',
                          'default_type': 'application/octet-stream',
                          'encoding': 'utf-8',
                          'default_extension': '.html'
                      }))