From a37ef7236bb2854773e663db463ffcf92074e3ec Mon Sep 17 00:00:00 2001 From: Nemo Date: Mon, 15 Jun 2020 00:30:05 +0530 Subject: [PATCH] [tests] Fix tests on Travis --- README.md | 10 ++++++---- hackertray/firefox.py | 2 +- test/firefox_test.py | 6 +++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 71d886d..d6ad561 100644 --- a/README.md +++ b/README.md @@ -65,11 +65,12 @@ Note that the `--chrome` and `--firefox` options are independent, and can be use ### Google Chrome Profile Path -Where your Profile is stored depends on which version of chrome you are using: +Where your Profile is stored depends on [which version of chrome you are using](https://chromium.googlesource.com/chromium/src.git/+/62.0.3202.58/docs/user_data_dir.md#linux): -- `google-chrome-stable`: `~/.config/google-chrome/Default/` -- `google-chrome-unstable`: `~/.config/google-chrome-unstable/Default/` -- `chromium`: `~/.config/chromium/Default/` +- [Chrome Stable] `~/.config/google-chrome/Default` +- [Chrome Beta] `~/.config/google-chrome-beta/Default` +- [Chrome Dev] `~/.config/google-chrome-unstable/Default` +- [Chromium] `~/.config/chromium/Default` Replace `Default` with `Profile 1`, `Profile 2` or so on if you use multiple profiles on Chrome. Note that the `--chrome` option accepts a `PROFILE-PATH`, not the History file itself. Also note that sometimes `~` might not be set, so you might need to use the complete path (such as `/home/nemo/.config/google-chrome/Default/`). @@ -112,6 +113,7 @@ On every launch, a request is made to `https://pypi.python.org/pypi/hackertray/j - Mark Rickert for [Hacker Bar](http://hackerbarapp.com/) (No longer active) - [Giridaran Manivannan](https://github.com/ace03uec) for troubleshooting instructions. +- [@cheeaun](https://github.com/cheeaun) for the [Unofficial Hacker News API](https://github.com/cheeaun/node-hnapi/) ## Licence diff --git a/hackertray/firefox.py b/hackertray/firefox.py index ae4bd66..08ea44d 100644 --- a/hackertray/firefox.py +++ b/hackertray/firefox.py @@ -12,7 +12,7 @@ class Firefox: @staticmethod def default_firefox_profile_path(): - profile_file_path = Path.home().joinpath(".mozilla/firefox/profiles.ini") + profile_file_path = str(Path.home().joinpath(".mozilla/firefox/profiles.ini")) profile_path = None if (os.path.exists(profile_file_path)): parser = configparser.ConfigParser() diff --git a/test/firefox_test.py b/test/firefox_test.py index faf504f..c95e7f8 100644 --- a/test/firefox_test.py +++ b/test/firefox_test.py @@ -19,8 +19,8 @@ class FirefoxTest(unittest.TestCase): def test_default(self): test_default_path = Path.home().joinpath(".mozilla/firefox/x0ran0o9.default") if(os.environ.get('TRAVIS') == 'true'): - if not os.path.exists(test_default_path): - os.makedirs(test_default_path) + if not os.path.exists(str(test_default_path)): + os.makedirs(str(test_default_path)) with open(str(Path.home().joinpath('.mozilla/firefox/profiles.ini')), 'w') as f: f.write(""" [Profile1] @@ -29,4 +29,4 @@ IsRelative=1 Path=x0ran0o9.default Default=1 """) - self.assertTrue(Firefox.default_firefox_profile_path()==Path.home().joinpath(".mozilla/firefox/x0ran0o9.default")) + self.assertTrue(Firefox.default_firefox_profile_path()==str(Path.home().joinpath(".mozilla/firefox/x0ran0o9.default")))