run tests on windows and mac

This commit is contained in:
Lex Berezhny 2021-07-30 10:21:52 -04:00
parent 4ddff96b1e
commit 5ab0035348
2 changed files with 33 additions and 4 deletions

View file

@ -31,8 +31,8 @@ jobs:
matrix:
os:
- ubuntu-latest
#- macos-latest
#- windows-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
@ -49,10 +49,18 @@ jobs:
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}
restore-keys: ${{ runner.os }}-pip-
- run: pip install --user --upgrade pip wheel
- run: pip install -e .[torrent,test]
- env:
- if: startsWith(runner.os, 'linux')
run: pip install -e .[torrent,test]
- if: startsWith(runner.os, 'linux')
env:
HOME: /tmp
run: make test-unit-coverage
- if: !startsWith(runner.os, 'linux')
run: pip install -e .[test]
- if: !startsWith(runner.os, 'linux')
env:
HOME: /tmp
run: python -m unittest tests/unit/test_conf.py
tests-integration:
name: "tests / integration"

View file

@ -21,6 +21,27 @@ class TestConfig(BaseConfig):
class ConfigurationTests(unittest.TestCase):
@unittest.skipIf('darwin' not in sys.platform, 'skipping mac only test')
def test_mac_defaults(self):
c = Config()
self.assertEqual(c.data_dir, os.path.expanduser("~/Library/Application Support/LBRY"))
self.assertEqual(c.wallet_dir, os.path.expanduser('~/.lbryum'))
self.assertEqual(c.download_dir, os.path.expanduser('~/Downloads'))
self.assertEqual(c.config, os.path.join(c.data_dir, 'daemon_settings.yml'))
self.assertEqual(c.api_connection_url, 'http://localhost:5279/lbryapi')
self.assertEqual(c.log_file_path, os.path.join(c.data_dir, 'lbrynet.log'))
@unittest.skipIf('win32' not in sys.platform, 'skipping windows only test')
def test_windows_defaults(self):
c = Config()
prefix = os.path.join(r"C:\Users", os.getlogin(), r"AppData\Local\lbry")
self.assertEqual(c.data_dir, os.path.join(prefix, 'lbrynet'))
self.assertEqual(c.wallet_dir, os.path.join(prefix, 'lbryum'))
self.assertEqual(c.download_dir, os.path.join(r"C:\Users", os.getlogin(), "Downloads"))
self.assertEqual(c.config, os.path.join(c.data_dir, 'daemon_settings.yml'))
self.assertEqual(c.api_connection_url, 'http://localhost:5279/lbryapi')
self.assertEqual(c.log_file_path, os.path.join(c.data_dir, 'lbrynet.log'))
@unittest.skipIf('linux' not in sys.platform, 'skipping linux only test')
def test_linux_defaults(self):
c = Config()