Example #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.txt"
        ds = TextLocalDataSet(filepath=filepath)
        ds_versioned = TextLocalDataSet(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)
Example #2
0
def txt_data_set_with_args(filepath_txt, request):
    return TextLocalDataSet(
        filepath=filepath_txt,
        load_args={"errors": "ignore"},
        save_args={"errors": "ignore"},
        **request.param
    )
Example #3
0
def versioned_txt_data_set(filepath_txt, load_version, save_version):
    return TextLocalDataSet(
        filepath=filepath_txt, version=Version(load_version, save_version)
    )
Example #4
0
def txt_data_set(filepath_txt, request):
    return TextLocalDataSet(filepath=filepath_txt, **request.param)
Example #5
0
 def test_filepath_expanduser(self):
     txt_dataset = TextLocalDataSet(filepath="~")
     assert "~" not in str(txt_dataset._filepath)  # pylint: disable=protected-access
Example #6
0
 def test_filepath_expanduser(self):
     txt_dataset = TextLocalDataSet(filepath="~")
     assert "~" not in str(txt_dataset._filepath)