forked from jarun/buku
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request jarun#665 from rachmadaniHaryono/bugfix/window-setup
Bugfix/window setup
- Loading branch information
Showing
2 changed files
with
30 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,32 @@ | ||
import pathlib | ||
|
||
import pytest | ||
|
||
def test_bukuserver_requirement(monkeypatch): | ||
def m_setup(**kwargs): | ||
|
||
@pytest.fixture | ||
def setup_obj(monkeypatch): | ||
def m_setup(**_): | ||
return None | ||
import setuptools | ||
monkeypatch.setattr(setuptools, 'setup', m_setup) | ||
import setup | ||
|
||
return setup | ||
|
||
|
||
def test_bukuserver_requirement(setup_obj): | ||
assert [ | ||
x | ||
for x in pathlib.Path("bukuserver/requirements.txt").read_text(encoding="utf8", errors="surrogateescape").splitlines() | ||
if "flask-reverse-proxy-fix" not in x | ||
] == setup.server_require | ||
] == setup_obj.server_require | ||
|
||
|
||
def test_buku_requirement(setup_obj): | ||
assert sorted( | ||
[ | ||
x | ||
for x in pathlib.Path("requirements.txt").read_text(encoding="utf8", errors="surrogateescape").splitlines() | ||
if not x.startswith('#') and x != 'setuptools' | ||
] | ||
) == sorted(setup_obj.install_requires) |