Esempio n. 1
0
    def test_nop(self, test_path):
        """Tests calling of build_path with no real arguments."""

        assert str(test_path) == str(path.build_path(test_path))
Esempio n. 2
0
    def test_str_path(self, test_path):
        """Tests calling of build_path with str path."""

        assert str(test_path) == str(path.build_path(str(test_path)))
Esempio n. 3
0
    def test_dir(self, test_path):
        """Tests changing directory of path."""

        result = path.build_path(test_path, dir_='other')
        assert str(result) == 'other/file.txt'
Esempio n. 4
0
    def test_ext_missing_ext(self, test_path):
        """Tests replacing ext of path that is missing an ext."""

        result = path.build_path(test_path.with_suffix(''), ext='.log')
        assert str(result) == 'path/to/file.log'
Esempio n. 5
0
    def test_ext(self, test_path):
        """Tests replacing ext of path."""

        result = path.build_path(test_path, ext='.log')
        assert str(result) == 'path/to/file.log'
Esempio n. 6
0
    def test_suffix_missing_ext(self, test_path):
        """Tests addition of suffix to path that is missing an ext."""

        result = path.build_path(test_path.with_suffix(''), suffix='.filt')
        assert str(result) == 'path/to/file.filt'
Esempio n. 7
0
    def test_suffix(self, test_path):
        """Tests addition of suffix to path."""

        result = path.build_path(test_path, suffix='.filt')
        assert str(result) == 'path/to/file.filt.txt'