-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/sort-sets-for-determinancy
- Loading branch information
Showing
5 changed files
with
49 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
- object: foo | ||
count: 10 | ||
fields: | ||
japanese_name: | ||
i18n_fake: | ||
locale: ja_JP | ||
fake: name |
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,25 @@ | ||
from io import StringIO | ||
from unittest import mock | ||
|
||
from snowfakery.data_generator import generate | ||
|
||
write_row_path = "snowfakery.output_streams.DebugOutputStream.write_row" | ||
|
||
|
||
def row_values(write_row_mock, index, value): | ||
return write_row_mock.mock_calls[index][1][1][value] | ||
|
||
|
||
class Testi18n: | ||
@mock.patch(write_row_path) | ||
def test_i18n(self, write_row_mock): | ||
yaml = """ | ||
- object: foo | ||
fields: | ||
japanese_name: | ||
i18n_fake: | ||
locale: ja_JP | ||
fake: name""" | ||
generate(StringIO(yaml), {}) | ||
assert isinstance(row_values(write_row_mock, 0, "japanese_name"), str) | ||
|