Skip to content

Commit

Permalink
chore: use StreamIDType in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Samika Kashyap authored and Samika Kashyap committed Aug 23, 2024
1 parent 5a1a0f2 commit 4c61204
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions flight/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ cid.workspace = true
serde.workspace = true
chrono = { version = "0.4", features = ["serde"] }
arrow.workspace = true
ceramic-core = { path = "../core" }

[dev-dependencies]
tokio = { workspace = true, features = ["macros", "rt"] }
Expand Down
7 changes: 4 additions & 3 deletions flight/src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use super::*;
use crate::types::{ConclusionData, ConclusionEvent, ConclusionInit};
use arrow::array::{Array, BinaryArray, ListArray, StringArray, UInt8Array};
use ceramic_core::StreamIdType;
use cid::Cid;

/// Tests the conversion of ConclusionEvents to Arrow RecordBatch.
Expand All @@ -20,7 +21,7 @@ fn test_conclusion_events_to_record_batch() {
ConclusionEvent::Data(ConclusionData {
id: Cid::default(),
init: ConclusionInit {
stream_type: 0,
stream_type: StreamIdType::Model as u8,
controller: "did:key:test1".to_string(),
dimensions: vec![],
},
Expand All @@ -30,7 +31,7 @@ fn test_conclusion_events_to_record_batch() {
ConclusionEvent::Data(ConclusionData {
id: Cid::default(),
init: ConclusionInit {
stream_type: 2,
stream_type: StreamIdType::Model as u8,
controller: "did:key:test2".to_string(),
dimensions: vec![],
},
Expand Down Expand Up @@ -70,7 +71,7 @@ fn test_conclusion_events_to_record_batch() {
.as_any()
.downcast_ref::<UInt8Array>()
.unwrap();
assert_eq!(stream_types.value(0), 0);
assert_eq!(stream_types.value(0), 2);
assert_eq!(stream_types.value(1), 2);

let controllers = record_batch
Expand Down

0 comments on commit 4c61204

Please sign in to comment.