def test_constructors(self): # Test that the new() function works t = Modulemd.Translation.new(1, "testmodule", "teststream", 42) assert t # Test that keywords are accepted t = Modulemd.Translation( version=1, module_name='testmodule', module_stream='teststream', modified=42) assert t assert t.validate() assert t.get_locales() == []
def test_issue80(self): mmd_translation = Modulemd.Translation(module_name="modulename", module_stream="modulestream", mdversion=1, modified=201809041500) entry = Modulemd.TranslationEntry(locale='en_US') mmd_translation.add_entry(entry) # Would crash attempting to dump to YAML try: yaml_output = mmd_translation.dumps() except GLib.GError as err: # A proper exception is expected here pass