feat: add util.get_home_path() function

This commit is contained in:
Lance Edgar 2024-11-23 11:56:30 -06:00
parent 26774bbcaf
commit d3bbc01e7a
2 changed files with 26 additions and 0 deletions

View file

@ -15,6 +15,15 @@ class TestExists(TestCase):
c.run.assert_called_once_with('test -e /foo', warn=True)
class TestHomePath(TestCase):
def test_basic(self):
c = MagicMock()
c.run.return_value.stdout = '/home/foo'
path = mod.get_home_path(c, user='foo')
self.assertEqual(path, '/home/foo')
class TestIsSymlink(TestCase):
def test_yes(self):