def test_dump(self): (module_index, failures) = Modulemd.index_from_file( "%s/test_data/long-valid.yaml" % os.getenv('MESON_SOURCE_ROOT')) assert len(failures) == 0 assert 'nodejs' in module_index yaml_out = module_index['nodejs'].dumps() assert 'scalable network applications' in yaml_out assert '20180308155546' in yaml_out assert 'document: modulemd-defaults' in yaml_out assert 'module: nodejs' in yaml_out
def test_file_parser(self): (module_index, failures) = Modulemd.index_from_file( "%s/test_data/long-valid.yaml" % os.getenv('MESON_SOURCE_ROOT')) assert len(failures) == 0 assert 'django' in module_index assert module_index['django'].props.name == 'django' streams = module_index['django'].get_streams() assert '1.6' in streams
def test_custom_repo(self): (module_index, failures) = Modulemd.index_from_file( "%s/spec.v2.yaml" % os.getenv('MESON_SOURCE_ROOT')) assert len(failures) == 0 foo_module = module_index['foo'] assert foo_module foo_stream = foo_module.get_stream_by_name('stream-name') assert foo_stream rpm_components = foo_stream.get_rpm_components() assert rpm_components bar_component = rpm_components['bar'] assert bar_component repo = bar_component.dup_repository() assert repo assert repo == "https://pagure.io/bar.git"