File: test_path_utils.py

package info (click to toggle)
mopidy-mpd 3.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 680 kB
  • sloc: python: 7,641; makefile: 3
file content (18 lines) | stat: -rw-r--r-- 506 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import os
import unittest

from tests import path_utils


# TODO: kill this in favour of just os.path.getmtime + mocks
class MtimeTest(unittest.TestCase):
    def tearDown(self):  # noqa: N802
        path_utils.mtime.undo_fake()

    def test_mtime_of_current_dir(self):
        mtime_dir = int(os.stat(".").st_mtime)
        assert mtime_dir == path_utils.mtime(".")

    def test_fake_time_is_returned(self):
        path_utils.mtime.set_fake_time(123456)
        assert path_utils.mtime(".") == 123456