Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nicpottier committed Apr 25, 2019
1 parent 5298195 commit f729a7a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 3 additions & 3 deletions archiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ func TestCreateMsgArchive(t *testing.T) {
assert.NoError(t, err)

// should have two records, second will have attachments
assert.Equal(t, 6, task.RecordCount)
assert.Equal(t, int64(646), task.Size)
assert.Equal(t, 3, task.RecordCount)
assert.Equal(t, int64(483), task.Size)
assert.Equal(t, time.Date(2017, 8, 12, 0, 0, 0, 0, time.UTC), task.StartDate)
assert.Equal(t, "5fe5adcd696342367bdc9b877e524f4a", task.Hash)
assert.Equal(t, "6fe9265860425cf1f9757ba3d91b1a05", task.Hash)
assertArchiveFile(t, task, "messages1.jsonl")

DeleteArchiveFile(task)
Expand Down
3 changes: 0 additions & 3 deletions testdata/messages1.jsonl
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{"id":1,"broadcast":null,"contact":{"uuid":"3e814add-e614-41f7-8b5d-a07f670a698f","name":"Ajodinabiff Dane"},"urn":"tel:+12067797777","channel":{"uuid":"60f2ed5b-05f2-4156-9ff0-e44e90da1b85","name":"Channel 2"},"direction":"in","type":"inbox","status":"handled","visibility":"visible","text":"message 1","attachments":[],"labels":[{"name": "Label 1", "uuid": "1d9e3188-b74b-4ae0-a166-0de31aedb34a"}, {"name": "Label 2", "uuid": "c5a69101-8dc3-444f-8b0b-5ab816e46eec"}],"created_on":"2017-08-12T21:11:59.890662+00:00","sent_on":"2017-08-12T21:11:59.890662+00:00","modified_on":"2017-08-12T21:11:59.890662+00:00"}
{"id":3,"broadcast":null,"contact":{"uuid":"3e814add-e614-41f7-8b5d-a07f670a698f","name":"Ajodinabiff Dane"},"urn":"tel:+12067797777","channel":null,"direction":"out","type":"inbox","status":"handled","visibility":"visible","text":"message 3","attachments":[{"url": "https://foo.bar/image1.png", "content_type": "image/png"}, {"url": "https://foo.bar/image2.png", "content_type": "image/png"}],"labels":[{"name": "Label 2", "uuid": "c5a69101-8dc3-444f-8b0b-5ab816e46eec"}],"created_on":"2017-08-12T21:11:59.890662+00:00","sent_on":"2017-08-12T21:11:59.890662+00:00","modified_on":"2017-08-12T21:11:59.890662+00:00"}
{"id":9,"broadcast":null,"contact":{"uuid":"3e814add-e614-41f7-8b5d-a07f670a698f","name":"Ajodinabiff Dane"},"urn":null,"channel":null,"direction":"out","type":"flow","status":"sent","visibility":"visible","text":"message 9","attachments":[],"labels":[],"created_on":"2017-08-12T21:11:59.890662+00:00","sent_on":"2017-08-12T21:11:59.890662+00:00","modified_on":"2017-08-12T21:11:59.890662+00:00"}
{"id":null,"broadcast":1,"contact":{"name": "John Arbies", "uuid": "2b8bd28d-43e0-4c34-a4bb-0f10b11fdb8a"},"text":"hello","urn":null,"channel":null,"direction":"out","type":"flow","status":"wired","visibility":"visible","attachments":[],"labels":[],"created_on":"2017-08-12T20:11:59.890662+00:00","sent_on":"2017-08-12T20:11:59.890662+00:00","modified_on":"2017-08-12T20:11:59.890662+00:00"}
{"id":null,"broadcast":1,"contact":{"name": null, "uuid": "b46f6e18-95b4-4984-9926-dded047f4eb3"},"text":"bonjour","urn":null,"channel":null,"direction":"out","type":"flow","status":"delivered","visibility":"visible","attachments":[],"labels":[],"created_on":"2017-08-12T20:11:59.890662+00:00","sent_on":"2017-08-12T20:11:59.890662+00:00","modified_on":"2017-08-12T20:11:59.890662+00:00"}
{"id":null,"broadcast":2,"contact":{"name": null, "uuid": "9195c8b7-6138-4d84-ac56-5192cc3d8ceb"},"text":"hola","urn":null,"channel":null,"direction":"out","type":"flow","status":"wired","visibility":"visible","attachments":[],"labels":[],"created_on":"2017-08-12T20:11:59.890662+00:00","sent_on":"2017-08-12T20:11:59.890662+00:00","modified_on":"2017-08-12T20:11:59.890662+00:00"}

0 comments on commit f729a7a

Please sign in to comment.