Skip to content

Commit

Permalink
Change test code for #149 PR
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin committed Mar 21, 2019
1 parent 743c878 commit 8c2bd81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions client/httpclient_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestHTTPClient_deSerializeKeyObj(t *testing.T) {
// MetaDataResObj deserialize
metaDataObjs, err := json.Marshal([]types.MetaDataObj{{RowKey: rowKey1, OwnerId: TestOwnerId, Qualifier: []byte(TestQualifier)}, {RowKey: rowKey2, OwnerId: TestOwnerId, Qualifier: []byte(TestQualifier)}})
require.Nil(err, "json marshal err: %+v", err)
outputQueryObjs, err := json.Marshal([]OutputQueryObj{{Id: rowKey1, Timestamp: timestamp1, OwnerId: TestOwnerId, Qualifier: TestQualifier}, {Id: rowKey2, Timestamp: timestamp2, OwnerId: TestOwnerId, Qualifier: TestQualifier}})
outputQueryObjs, err := json.MarshalIndent([]OutputQueryObj{{Id: rowKey1, Timestamp: timestamp1, OwnerId: TestOwnerId, Qualifier: TestQualifier}, {Id: rowKey2, Timestamp: timestamp2, OwnerId: TestOwnerId, Qualifier: TestQualifier}}, "", " ")
require.Nil(err, "json marshal err: %+v", err)

deserializedBytes, err := deSerializeKeyObj(metaDataObjs, true)
Expand All @@ -33,7 +33,7 @@ func TestHTTPClient_deSerializeKeyObj(t *testing.T) {
// RealDataResObj deserialize
realDataObjs, err := json.Marshal([]types.RealDataObj{{RowKey: rowKey1, Data: []byte("testData1")}, {RowKey: rowKey2, Data: []byte("testData2")}})
require.Nil(err, "json marshal err: %+v", err)
outputFetchObjs, err := json.Marshal([]OutputFetchObj{{Id: rowKey1, Timestamp: timestamp1, Data: []byte("testData1")}, {Id: rowKey2, Timestamp: timestamp2, Data: []byte("testData2")}})
outputFetchObjs, err := json.MarshalIndent([]OutputFetchObj{{Id: rowKey1, Timestamp: timestamp1, Data: []byte("testData1")}, {Id: rowKey2, Timestamp: timestamp2, Data: []byte("testData2")}}, "", " ")
require.Nil(err, "json marshal err: %+v", err)

deserializedBytes, err = deSerializeKeyObj(realDataObjs, false)
Expand Down
4 changes: 2 additions & 2 deletions client/httpclient_read_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (suite *ClientTestSuite) TestClient_Query() {
rowKey := types.GetRowKey(timestamp, 0)
tx, err := json.Marshal([]types.BaseDataObj{{MetaData: types.MetaDataObj{RowKey: rowKey, OwnerId: TestOwnerId, Qualifier: []byte(TestQualifier)}, RealData: types.RealDataObj{RowKey: rowKey, Data: data}}})
require.Nil(err, "json marshal err: %+v", err)
expectedValue, err := json.Marshal([]client.OutputQueryObj{{Id: rowKey, Timestamp: timestamp, OwnerId: TestOwnerId, Qualifier: TestQualifier}})
expectedValue, err := json.MarshalIndent([]client.OutputQueryObj{{Id: rowKey, Timestamp: timestamp, OwnerId: TestOwnerId, Qualifier: TestQualifier}}, "", " ")
require.Nil(err, "json marshal err: %+v", err)

c := rpcClient.NewLocal(node)
Expand Down Expand Up @@ -48,7 +48,7 @@ func (suite *ClientTestSuite) TestClient_Fetch() {
rowKey := types.GetRowKey(timestamp, 0)
tx, err := json.Marshal([]types.BaseDataObj{{MetaData: types.MetaDataObj{RowKey: rowKey, OwnerId: TestOwnerId, Qualifier: []byte(TestQualifier)}, RealData: types.RealDataObj{RowKey: rowKey, Data: data}}})
require.Nil(err, "json marshal err: %+v", err)
expectedValue, err := json.Marshal([]client.OutputFetchObj{{Id: rowKey, Timestamp: timestamp, Data: data}})
expectedValue, err := json.MarshalIndent([]client.OutputFetchObj{{Id: rowKey, Timestamp: timestamp, Data: data}}, "", " ")
require.Nil(err, "json marshal err: %+v", err)

c := rpcClient.NewLocal(node)
Expand Down

0 comments on commit 8c2bd81

Please sign in to comment.