示例#1
0
    def test_version_str_repr(self, load_version, save_version):
        """Test that version is in string representation of the class instance
        when applicable."""
        filepath = "test.json"
        ds = NetworkXLocalDataSet(filepath=filepath)
        ds_versioned = NetworkXLocalDataSet(filepath=filepath,
                                            version=Version(
                                                load_version, save_version))
        assert filepath in str(ds)
        assert "version" not in str(ds)

        assert filepath in str(ds_versioned)
        ver_str = "version=Version(load={}, save='{}')".format(
            load_version, save_version)
        assert ver_str in str(ds_versioned)
示例#2
0
def networkx_data_set_args(filepath_json):
    attrs = dict(
        source="from", target="to", name="fake_id", key="fake_key", link="fake_link"
    )
    return NetworkXLocalDataSet(
        filepath=filepath_json, load_args={"attrs": attrs}, save_args={"attrs": attrs}
    )
示例#3
0
def versioned_networkx_data_set(filepath_json, load_version, save_version):
    return NetworkXLocalDataSet(
        filepath=filepath_json, version=Version(load_version, save_version)
    )
示例#4
0
def networkx_data_set(filepath_json):
    return NetworkXLocalDataSet(filepath=filepath_json)