From 07b195e958f4e2a535d2788ad3143fc02307a7b2 Mon Sep 17 00:00:00 2001 From: sunwp <244372610@qq.com> Date: Wed, 8 Dec 2021 20:16:36 +0800 Subject: [PATCH] unit test (#898) Signed-off-by: sunwp <244372610@qq.com> --- pkg/source/hdfsprotocol/hdfs_source_client_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/source/hdfsprotocol/hdfs_source_client_test.go b/pkg/source/hdfsprotocol/hdfs_source_client_test.go index e0b6bed4b62..c63962a1b75 100644 --- a/pkg/source/hdfsprotocol/hdfs_source_client_test.go +++ b/pkg/source/hdfsprotocol/hdfs_source_client_test.go @@ -43,7 +43,7 @@ const ( hdfsExistFileURL = "hdfs://" + hdfsExistFileHost + hdfsExistFilePath hdfsExistFileContentLength int64 = 12 hdfsExistFileContent = "Hello World\n" - hdfsExistFileLastModifiedMillis int64 = 1625218150000 + hdfsExistFileLastModifiedMillis int64 = 1136214245000 hdfsExistFileLastModified = "Mon, 02 Jan 2006 15:04:05 GMT" hdfsExistFileRangeStart int64 = 3 hdfsExistFileRangeEnd int64 = 10 @@ -52,6 +52,7 @@ const ( const ( hdfsNotExistFileURL = "hdfs://127.0.0.1:9000/user/root/input/f3.txt" hdfsNotExistFileContentLength int64 = source.UnknownSourceFileLen + hdfsNotExistLastModified int64 = -1 ) var fakeHDFSClient = &hdfs.Client{} @@ -344,7 +345,7 @@ func TestGetLastModified_FileNotExist(t *testing.T) { lastModifiedMillis, err := sourceClient.GetLastModified(request) assert.EqualError(t, err, "stat /user/root/input/f3.txt: file does not exist") - assert.Equal(t, hdfsNotExistFileContentLength, lastModifiedMillis) + assert.Equal(t, hdfsNotExistLastModified, lastModifiedMillis) } func TestNewHDFSSourceClient(t *testing.T) {