Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Commit819659d

Browse files
committed
🧪 updated tests
1 parentc4b5489 commit819659d

7 files changed

+400
-353
lines changed

‎tests/__snapshots__/test_screenshots.ambr

+347-348
Large diffs are not rendered by default.

‎tests/conftest.py

+11
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
importpathlib
66
fromtypingimportAny,Dict,List
77

8+
importpyperclip
89
importpytest
910
fromclick.testingimportCliRunner
1011
fromtextual_universal_directorytreeimportGitHubPath
@@ -44,6 +45,16 @@ def github_release_path() -> GitHubPath:
4445
returnGitHubPath(uri)
4546

4647

48+
@pytest.fixture(autouse=True)
49+
defcopy_supported(monkeypatch:pytest.MonkeyPatch)->None:
50+
"""
51+
Override _copy_supported
52+
"""
53+
monkeypatch.setattr(
54+
pyperclip,"determine_clipboard",lambda: (lambda:True,lambda:True)
55+
)
56+
57+
4758
@pytest.fixture(scope="module")
4859
defvcr_config()->Dict[str,List[Any]]:
4960
"""

‎tests/debug_app.py

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""
2+
App Debugging
3+
"""
4+
5+
importpytest
6+
7+
frombrowsr.baseimportTextualAppContext
8+
frombrowsr.browsrimportBrowsr
9+
10+
11+
@pytest.mark.asyncio
12+
asyncdeftest_debug_app()->None:
13+
"""
14+
Test the actual browsr app
15+
"""
16+
config=TextualAppContext(file_path="s3://",debug=True)
17+
app=Browsr(config_object=config)
18+
asyncwithapp.run_test()aspilot:
19+
_=pilot.app

‎tests/test_browsr.py

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"""
2+
Test the actual browsr app
3+
"""
4+
5+
importpytest
6+
7+
frombrowsr.baseimportTextualAppContext
8+
frombrowsr.browsrimportBrowsr
9+
10+
11+
deftest_bad_path()->None:
12+
"""
13+
Test a bad path
14+
"""
15+
withpytest.raises(FileNotFoundError):
16+
_=Browsr(
17+
config_object=TextualAppContext(file_path="bad_file_path.csv",debug=True)
18+
)

‎tests/test_cli.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
fromclick.testingimportCliRunner
66

7-
frombrowsr._cliimportbrowsr
7+
frombrowsr.cliimportbrowsr
88

99

1010
deftest_cli_main(runner:CliRunner)->None:

‎tests/test_config.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
fromtextual_universal_directorytreeimportGitHubPath
88

9-
frombrowsr._baseimportTextualAppContext
10-
frombrowsr._configimportfavorite_themes
9+
frombrowsr.baseimportTextualAppContext
10+
frombrowsr.configimportfavorite_themes
1111
fromtests.conftestimportcassette
1212

1313

‎tests/test_screenshots.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
@pytest.fixture
1616
defapp_file()->str:
1717
file_content="""
18-
from browsr import Browsr
19-
from browsr._base import TextualAppContext
18+
from browsr.browsr import Browsr
19+
from browsr.base import TextualAppContext
2020
2121
file_path = "{file_path}"
2222
context = TextualAppContext(file_path=file_path)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp