From 054df2b58b5d68ffb7aa3bdd2db2a50343e73bf6 Mon Sep 17 00:00:00 2001 From: shreyas-goenka <88374338+shreyas-goenka@users.noreply.github.com> Date: Fri, 6 Oct 2023 20:09:56 +0200 Subject: [PATCH] Fix workspace import test (#844) Windows and unix have different new line characters. Separating the string assertions here to make the test pass. --- internal/workspace_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/workspace_test.go b/internal/workspace_test.go index 21ef8231..a6e641b6 100644 --- a/internal/workspace_test.go +++ b/internal/workspace_test.go @@ -369,7 +369,8 @@ func TestAccImportFileFormatAuto(t *testing.T) { // Upload as file if path has no extension RequireSuccessfulRun(t, "workspace", "import", path.Join(targetDir, "py-nb-as-file"), "--file", "./testdata/import_dir/pyNotebook.py", "--format=AUTO") - assertFilerFileContents(t, ctx, workspaceFiler, "py-nb-as-file", "# Databricks notebook source\nprint(\"python\")") + assertFilerFileContents(t, ctx, workspaceFiler, "py-nb-as-file", "# Databricks notebook source") + assertFilerFileContents(t, ctx, workspaceFiler, "py-nb-as-file", "print(\"python\")") assertWorkspaceFileType(t, ctx, workspaceFiler, "py-nb-as-file", workspace.ObjectTypeFile) // Upload as notebook if path has extension @@ -379,6 +380,6 @@ func TestAccImportFileFormatAuto(t *testing.T) { // Upload as file if content is not notebook (even if path has .py extension) RequireSuccessfulRun(t, "workspace", "import", path.Join(targetDir, "not-a-notebook.py"), "--file", "./testdata/import_dir/file-a", "--format=AUTO") - assertFilerFileContents(t, ctx, workspaceFiler, "not-a-notebook.py", "hello, world\n") + assertFilerFileContents(t, ctx, workspaceFiler, "not-a-notebook.py", "hello, world") assertWorkspaceFileType(t, ctx, workspaceFiler, "not-a-notebook.py", workspace.ObjectTypeFile) }