コード例 #1
0
ファイル: test_text_local.py プロジェクト: yzhu32/kedro
    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)
コード例 #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
    )
コード例 #3
0
ファイル: test_text_local.py プロジェクト: zulyang/kedro
def versioned_txt_data_set(filepath_txt, load_version, save_version):
    return TextLocalDataSet(
        filepath=filepath_txt, version=Version(load_version, save_version)
    )
コード例 #4
0
ファイル: test_text_local.py プロジェクト: zulyang/kedro
def txt_data_set(filepath_txt, request):
    return TextLocalDataSet(filepath=filepath_txt, **request.param)
コード例 #5
0
ファイル: test_text_local.py プロジェクト: yzhu32/kedro
 def test_filepath_expanduser(self):
     txt_dataset = TextLocalDataSet(filepath="~")
     assert "~" not in str(txt_dataset._filepath)  # pylint: disable=protected-access
コード例 #6
0
ファイル: test_text_local.py プロジェクト: zach-data/kedro
 def test_filepath_expanduser(self):
     txt_dataset = TextLocalDataSet(filepath="~")
     assert "~" not in str(txt_dataset._filepath)