emmental/tests/test_path.py
Anna Schumaker 35d0d815ca audio: Load a track requested by the user
Either through the command line, mpris2, or the open button in the
header.

Implements: #7 (Add MPRIS2 Support)
Implements: #47 (Signal that the track has changed when it actually changes)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2023-04-12 10:41:58 -04:00

22 lines
626 B
Python

# Copyright 2022 (c) Anna Schumaker.
"""Tests our custom Path class."""
import pathlib
import unittest
import emmental.path
class TestPath(unittest.TestCase):
"""Test our path module."""
def test_from_uri(self):
"""Test getting a path from a uri."""
p = emmental.path.from_uri("file:///a/b/c.txt")
self.assertIsInstance(p, pathlib.Path)
self.assertEqual(str(p), "/a/b/c.txt")
p = emmental.path.from_uri("file:///a/b%20c/d.txt")
self.assertEqual(str(p), "/a/b c/d.txt")
p = emmental.path.from_uri("/a/b/c.txt")
self.assertEqual(str(p), "/a/b/c.txt")