Skip to content

Commit

Permalink
Set the environment variable fossil needs
Browse files Browse the repository at this point in the history
  • Loading branch information
thebeanogamer committed Oct 1, 2023
1 parent bd99939 commit 45f063b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/segments_test/fossil_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import unittest
from contextlib import ExitStack
from os import environ

import mock
import tempfile
Expand All @@ -19,6 +20,7 @@

class FossilTest(unittest.TestCase):

@mock.patch.dict(environ, {"USER": "root"})
def setUp(self):
self.powerline = mock.MagicMock()
self.powerline.segment_conf.side_effect = dict_side_effect_fn({
Expand Down Expand Up @@ -61,12 +63,14 @@ def test_non_fossil_directory(self):
self.segment.add_to_powerline()
self.assertEqual(self.powerline.append.call_count, 0)

@mock.patch.dict(environ, {"USER": "root"})
def test_standard(self):
self._add_and_commit("foo")
self.segment.start()
self.segment.add_to_powerline()
self.assertEqual(self.powerline.append.call_args[0][0], " trunk ")

@mock.patch.dict(environ, {"USER": "root"})
def test_different_branch(self):
self._add_and_commit("foo")
self._checkout_new_branch("bar")
Expand Down

0 comments on commit 45f063b

Please sign in to comment.