Ejemplo n.º 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'
                      }))
Ejemplo n.º 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'
                      }))
Ejemplo n.º 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'
                      }))
Ejemplo n.º 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'
                      }))
Ejemplo n.º 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'
                      }))
Ejemplo n.º 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'
                      }))