def test_three_way_two_entities(self): ab_cd_ftl = parse(FTLParser, ftl(''' # This Source Code Form is subject to the terms of … empty = Brak pobranych plików ''')) subset = ('title', 'download-state-downloading') resource = merge_resource( self, self.en_us_ftl, ab_cd_ftl, self.transforms, in_changeset=lambda x: x in subset ) self.assertEqual( resource.toJSON(), ftl_resource_to_json(''' # This Source Code Form is subject to the terms of … # A generic comment. title = Pobrane pliki empty = Brak pobranych plików # A section comment. [[ Menu items ]] download-state-downloading = Pobieranie… ''') )
def test_merge_three_way(self): resource = merge_resource( self, self.en_us_ftl, self.ab_cd_ftl, self.transforms, in_changeset=lambda x: True ) self.assertEqual( resource.toJSON(), ftl_resource_to_json(''' # This Source Code Form is subject to the terms of … # A generic comment. title = Pobrane pliki empty = Brak pobranych plików # A section comment. [[ Menu items ]] # A message comment. open-menuitem = [html/label] Otwórz download-state-downloading = Pobieranie… ''') )
def test_two_way_one_entity(self): subset = ('title',) resource = merge_resource( self, self.en_us_ftl, FTL.Resource(), self.transforms, in_changeset=lambda x: x in subset ) self.assertEqual( resource.toJSON(), ftl_resource_to_json(''' # This Source Code Form is subject to the terms of … # A generic comment. title = Pobrane pliki ''') )
def test_merge_two_way(self): resource = merge_resource( self, self.en_us_ftl, FTL.Resource(), self.transforms, in_changeset=lambda x: True ) self.assertEqual( resource.toJSON(), ftl_resource_to_json(''' title = Pobrane pliki about = Hardcoded Value open-menuitem = [html/label] Otwórz download-state-downloading = Pobieranie… ''') )
def test_merge_three_way(self): resource = merge_resource( self, self.en_us_ftl, self.ab_cd_ftl, self.transforms, in_changeset=lambda x: True ) self.assertEqual( resource.toJSON(), ftl_resource_to_json(''' title = Pobrane pliki empty = Brak pobranych plików about = Previously Hardcoded Value open-menuitem = [html/label] Otwórz download-state-downloading = Pobieranie… ''') )
def test_two_way_two_entities(self): subset = ('title', 'download-state-downloading') resource = merge_resource( self, self.en_us_ftl, FTL.Resource(), self.transforms, in_changeset=lambda x: x in subset ) self.assertEqual( resource.toJSON(), ftl_resource_to_json(''' # This Source Code Form is subject to the terms of … # A generic comment. title = Pobrane pliki # A section comment. [[ Menu items ]] download-state-downloading = Pobieranie… ''') )
def test_three_way_one_entity_existing_section(self): ab_cd_ftl = parse(FTLParser, ftl(''' # This Source Code Form is subject to the terms of … empty = Brak pobranych plików # A section comment. [[ Menu items ]] # A message comment. open-menuitem = [html/label] Otwórz ''')) subset = ('title',) resource = merge_resource( self, self.en_us_ftl, ab_cd_ftl, self.transforms, in_changeset=lambda x: x in subset ) self.assertEqual( resource.toJSON(), ftl_resource_to_json(''' # This Source Code Form is subject to the terms of … # A generic comment. title = Pobrane pliki empty = Brak pobranych plików # A section comment. [[ Menu items ]] # A message comment. open-menuitem = [html/label] Otwórz ''') )
def test_three_way_one_entity(self): ab_cd_ftl = parse(FTLParser, ftl(''' # This Source Code Form is subject to the terms of … empty = Brak pobranych plików ''')) subset = ('title',) resource = merge_resource( self, self.en_us_ftl, ab_cd_ftl, self.transforms, in_changeset=lambda x: x in subset ) self.assertEqual( resource.toJSON(), ftl_resource_to_json(''' # This Source Code Form is subject to the terms of … # A generic comment. title = Pobrane pliki empty = Brak pobranych plików ''') )