Skip to content

Commit

Permalink
1.19.01
Browse files Browse the repository at this point in the history
  • Loading branch information
maqp committed Jan 24, 2019
1 parent 659aa6b commit c2b2c77
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ before_install:
- gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
- sudo apt update
- sudo apt install python3-setuptools python3-tk tor -y
- export TZ=Europe/Helsinki

install:
- pip install pytest pytest-cov pyyaml coveralls
Expand Down
3 changes: 3 additions & 0 deletions tests/common/test_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,17 @@ def test_get_path_to_file_gui(self, *_):
self.assertEqual(ask_path_gui('path to file:', self.settings, get_file=True),
self.file_path)

@unittest.skipIf("TRAVIS" in os.environ and os.environ["TRAVIS"] == "true", "Skip as Travis has no $DISPLAY.")
@mock.patch('tkinter.filedialog.askopenfilename', return_value='')
def test_no_path_to_file_raises_fr(self, _):
self.assert_fr("File selection aborted.", ask_path_gui, 'test message', self.settings, True)

@unittest.skipIf("TRAVIS" in os.environ and os.environ["TRAVIS"] == "true", "Skip as Travis has no $DISPLAY.")
@mock.patch('tkinter.filedialog.askdirectory', return_value=path)
def test_get_path_gui(self, _):
self.assertEqual(ask_path_gui('select path for file:', self.settings), self.path)

@unittest.skipIf("TRAVIS" in os.environ and os.environ["TRAVIS"] == "true", "Skip as Travis has no $DISPLAY.")
@mock.patch('tkinter.filedialog.askdirectory', return_value='')
def test_no_path_raises_fr(self, _):
self.assert_fr("Path selection aborted.", ask_path_gui, 'test message', self.settings, False)
Expand Down

0 comments on commit c2b2c77

Please sign in to comment.