How to use the pyp2rpm.command.extract_dist.extract_dist function in pyp2rpm

To help you get started, we’ve selected a few pyp2rpm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fedora-python / pyp2rpm / tests / test_extract_distribution.py View on Github external
def test_serializing_metadata_to_stdout_success(self, metadata, capsys):
        flexmock(extract_dist).should_receive('__init__').and_return(None)
        command = extract_dist()
        command.metadata = metadata
        command.stdout = True
        command.run()
        out, err = capsys.readouterr()
        assert not err
github fedora-python / pyp2rpm / tests / test_extract_distribution.py View on Github external
def test_serializing_metadata_to_stdout_success(self, metadata, capsys):
        flexmock(extract_dist).should_receive('__init__').and_return(None)
        command = extract_dist()
        command.metadata = metadata
        command.stdout = True
        command.run()
        out, err = capsys.readouterr()
        assert not err
github fedora-python / pyp2rpm / pyp2rpm / command / extract_dist.py View on Github external
def run(self):
        """Sends extracted metadata in json format to stdout if stdout
        option is specified, assigns metadata dictionary to class_metadata
        variable otherwise.
        """
        if self.stdout:
            sys.stdout.write("extracted json data:\n" + json.dumps(
                self.metadata, default=to_str) + "\n")
        else:
            extract_dist.class_metadata = self.metadata
github fedora-python / pyp2rpm / pyp2rpm / module_runners.py View on Github external
def results(self):
        return extract_dist.extract_dist.class_metadata