-
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.
- Loading branch information
1 parent
9db4c0a
commit 8952177
Showing
14 changed files
with
125 additions
and
91 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Binary file not shown.
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,28 @@ | ||
import pytest | ||
import punctilious as pu | ||
|
||
|
||
class TestRepresentation: | ||
def test_representation(self): | ||
en = pu.presentation.Tag('language', 'en') | ||
fr = pu.presentation.Tag('language', 'fr') | ||
symbol = pu.presentation.Tag('connector_representation', 'symbol') | ||
word = pu.presentation.Tag('connector_representation', 'word') | ||
|
||
x = pu.presentation.RendererForStringConstant(string_constant='and', tags=(en, word,)) | ||
y = pu.presentation.RendererForStringConstant(string_constant='et', tags=(fr, word,)) | ||
z = pu.presentation.RendererForStringConstant(string_constant='∧', tags=(symbol,)) | ||
rep = pu.presentation.Representation(renderers=(x, y, z,)) | ||
|
||
prefs = pu.presentation.TagsPreferences() | ||
prefs[en] = 6 | ||
prefs[fr] = 9 | ||
prefs[symbol] = 100 | ||
prefs[word] = 1 | ||
assert (rep.rep(prefs=prefs) == '∧') | ||
|
||
prefs[word] = 100 | ||
assert (rep.rep(prefs=prefs) == 'et') | ||
|
||
prefs[en] = 500 | ||
assert (rep.rep(prefs=prefs) == 'and') |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.