forked from reflex-dev/reflex
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[REF-2141] Custom component command improvements (reflex-dev#2807)
* add custom component command improvements * fix test * fix regex to include both single/double quotes
- Loading branch information
Showing
7 changed files
with
182 additions
and
49 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
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
Empty file.
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from unittest.mock import mock_open | ||
|
||
import pytest | ||
|
||
from reflex.custom_components.custom_components import _get_version_to_publish | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"version_string", | ||
[ | ||
"version='0.1.0'", | ||
"version ='0.1.0'", | ||
"version= '0.1.0'", | ||
"version = '0.1.0'", | ||
"version = '0.1.0' ", | ||
'version="0.1.0"', | ||
'version ="0.1.0"', | ||
'version = "0.1.0"', | ||
'version = "0.1.0" ', | ||
], | ||
) | ||
def test_get_version_to_publish(version_string, mocker): | ||
python_toml = f"""[tool.poetry] | ||
name = \"test\" | ||
{version_string} | ||
description = \"test\" | ||
""" | ||
open_mock = mock_open(read_data=python_toml) | ||
mocker.patch("builtins.open", open_mock) | ||
assert _get_version_to_publish() == "0.1.0" |
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