fix: add sum to integration test

This commit is contained in:
sh0rez 2019-10-29 22:16:59 +01:00
parent 12a8bc9d9d
commit b23411fe58
No known key found for this signature in database
GPG key ID: 87C71DF9F8181FF1

View file

@ -44,13 +44,13 @@ func TestInstallCommand(t *testing.T) {
URIs: []string{"github.com/jsonnet-bundler/jsonnet-bundler@v0.1.0"}, URIs: []string{"github.com/jsonnet-bundler/jsonnet-bundler@v0.1.0"},
ExpectedCode: 0, ExpectedCode: 0,
ExpectedJsonnetFile: []byte(`{"dependencies": [{"name": "jsonnet-bundler", "source": {"git": {"remote": "https://github.com/jsonnet-bundler/jsonnet-bundler", "subdir": ""}}, "version": "v0.1.0"}]}`), ExpectedJsonnetFile: []byte(`{"dependencies": [{"name": "jsonnet-bundler", "source": {"git": {"remote": "https://github.com/jsonnet-bundler/jsonnet-bundler", "subdir": ""}}, "version": "v0.1.0"}]}`),
ExpectedJsonnetLockFile: []byte(`{"dependencies": [{"name": "jsonnet-bundler", "source": {"git": {"remote": "https://github.com/jsonnet-bundler/jsonnet-bundler", "subdir": ""}}, "version": "080f157c7fb85ad0281ea78f6c641eaa570a582f"}]}`), ExpectedJsonnetLockFile: []byte(`{"dependencies": [{"name": "jsonnet-bundler", "source": {"git": {"remote": "https://github.com/jsonnet-bundler/jsonnet-bundler", "subdir": ""}}, "version": "080f157c7fb85ad0281ea78f6c641eaa570a582f", "sum": "W1uI550rQ66axRpPXA2EZDquyPg/5PHZlvUz1NEzefg="}]}`),
}, { }, {
Name: "Relative", Name: "Relative",
URIs: []string{"jsonnet/foobar"}, URIs: []string{"jsonnet/foobar"},
ExpectedCode: 0, ExpectedCode: 0,
ExpectedJsonnetFile: []byte(`{"dependencies": [{"name": "foobar", "source": {"local": {"directory": "jsonnet/foobar"}}, "version": ""}]}`), ExpectedJsonnetFile: []byte(`{"dependencies": [{"name": "foobar", "source": {"local": {"directory": "jsonnet/foobar"}}, "version": ""}]}`),
ExpectedJsonnetLockFile: []byte(`{"dependencies": [{"name": "foobar", "source": {"local": {"directory": "jsonnet/foobar"}}, "version": ""}]}`), ExpectedJsonnetLockFile: []byte(`{"dependencies": [{"name": "foobar", "source": {"local": {"directory": "jsonnet/foobar"}}, "version": "", "sum": "47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU="}]}`),
}, },
} }
@ -74,7 +74,7 @@ func TestInstallCommand(t *testing.T) {
jsonnetFileContent(t, jsonnetfile.File, []byte(`{}`)) jsonnetFileContent(t, jsonnetfile.File, []byte(`{}`))
installCommand("", "vendor", tc.URIs...) installCommand("", "vendor", tc.URIs)
jsonnetFileContent(t, jsonnetfile.File, tc.ExpectedJsonnetFile) jsonnetFileContent(t, jsonnetfile.File, tc.ExpectedJsonnetFile)
jsonnetFileContent(t, jsonnetfile.LockFile, tc.ExpectedJsonnetLockFile) jsonnetFileContent(t, jsonnetfile.LockFile, tc.ExpectedJsonnetLockFile)