Skip to content

Commit 91297d8

Browse files
committed
update unit tests
1 parent df21336 commit 91297d8

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

cypherGenerator_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ func TestFileInfoToCypher(t *testing.T) {
3030
{
3131
fileInfo { Id: "fileId", Name: "someDir", IsDir: true, },
3232
"testLabel",
33-
"CREATE (fileId:testLabel { name: 'someDir', url: '' })",
33+
"CREATE (fileId:testLabel { name: 'someDir', path: '', url: '', _tempId: 'fileId' })",
3434
},
3535
{
3636
fileInfo { Name: "someDir", IsDir: true, Url: "https://github.com/someName/someRepo/tree/master/someDir" },
3737
"testLabel",
38-
"CREATE (:testLabel { name: 'someDir', url: 'https://github.com/someName/someRepo/tree/master/someDir' })",
38+
"CREATE (:testLabel { name: 'someDir', path: '', url: 'https://github.com/someName/someRepo/tree/master/someDir', _tempId: '' })",
3939
},
4040
{
4141
fileInfo { Id: "fileId", Name: "someFile", IsDir: false, Size: 42, CommitCount: 23, ModTime: 111222333, Extension: "go" },
4242
"testLabel",
43-
"CREATE (fileId:testLabel { name: 'someFile', url: '', size: 42, commitCount: 23, lastModifiedDateTime: datetime({ epochseconds: 111222333 }), lastModifiedTimestamp: 111222333, extension: 'go' })",
43+
"CREATE (fileId:testLabel { name: 'someFile', path: '', url: '', _tempId: 'fileId', size: 42, commitCount: 23, lastModifiedDateTime: datetime({ epochseconds: 111222333 }), lastModifiedTimestamp: 111222333, extension: 'go' })",
4444
},
4545
}
4646
for _, table := range testTables {
@@ -101,8 +101,8 @@ func TestFolderStructureToCypher(t *testing.T) {
101101
cypherResult string
102102
}{
103103
{
104-
fileInfo { Id: "someFileId", ParentId: "someParentId" },
105-
"CREATE (someFileId)-[:IN_FOLDER]->(someParentId)",
104+
fileInfo { Path: "someFilePath", ParentPath: "someParentPath" },
105+
"Match (a:directory { path: 'someParentPath' }) Match (b { path: 'someFilePath' }) CREATE (b)-[:IN_FOLDER]->(a)",
106106
},
107107
}
108108
for _, table := range testTables {

git2cypher.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"flag"
66
"path/filepath"
77
"os"
8-
"os/exec"
98
"log"
109
"strings"
1110
)

0 commit comments

Comments
 (0)