Esempio n. 1
0
  def test_decode_path(self):
    self.assertIsNone(Utils.decode_path(""))
    with self.assertRaises(TypeError): Utils.decode_path()

    path = '/some/path with spaces/to/file.txt'
    encoded_path = '%2Fsome%2Fpath%20with%20spaces%2Fto%2Ffile.txt'
    self.assertEqual(Utils.decode_path(encoded_path), path.replace('/', Utils.os_separator()))
Esempio n. 2
0
    def test_decode_path(self):
        self.assertIsNone(Utils.decode_path(""))
        with self.assertRaises(TypeError):
            Utils.decode_path()

        path = '/some/path with spaces/to/file.txt'
        encoded_path = '%2Fsome%2Fpath%20with%20spaces%2Fto%2Ffile.txt'
        self.assertEqual(Utils.decode_path(encoded_path),
                         path.replace('/', Utils.os_separator()))
Esempio n. 3
0
 def test_os_separator(self):
     self.assertNotEqual(os.sep, '')
     self.assertEqual(os.sep, Utils.os_separator())
Esempio n. 4
0
 def test_os_separator(self):
   self.assertNotEqual(os.sep, '')
   self.assertEqual(os.sep, Utils.os_separator())