File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 11.tox
22* .pyc
3+ .eggs /
4+ fluent.egg-info /
Original file line number Diff line number Diff line change @@ -19,6 +19,36 @@ def here(*parts):
1919 return os .path .join (dirname , * parts )
2020
2121
22+ class TestMergeContext_AddTransforms (unittest .TestCase ):
23+ def setUp (self ):
24+ self .ctx = MergeContext (
25+ lang = 'pl' ,
26+ reference_dir = here ('fixtures/en-US' ),
27+ localization_dir = here ('fixtures/pl' )
28+ )
29+
30+ def test_hardcoded_node (self ):
31+ self .ctx .add_transforms ('aboutDownloads.ftl' , 'aboutDownloads.ftl' , [
32+ FTL .Message (
33+ id = FTL .Identifier ('about' ),
34+ value = FTL .Pattern ([
35+ FTL .TextElement ('Hardcoded Value' )
36+ ])
37+ ),
38+ ])
39+ self .assertSetEqual (
40+ self .ctx .dependencies [(u'aboutDownloads.ftl' , u'about' )],
41+ set ()
42+ )
43+ self .assertTrue (
44+ self .ctx .in_changeset (
45+ set (),
46+ set (),
47+ 'aboutDownloads.ftl' , 'about'
48+ )
49+ )
50+
51+
2252class TestMergeContext (unittest .TestCase ):
2353 def setUp (self ):
2454 self .ctx = MergeContext (
You can’t perform that action at this time.
0 commit comments