MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / test_get_next_device_queue_item

Function test_get_next_device_queue_item

chirpstack/src/downlink/data.rs:2737–3034  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2735
2736 #[tokio::test]
2737 async fn test_get_next_device_queue_item() {
2738 let _guard = test::prepare().await;
2739
2740 let t = tenant::create(tenant::Tenant {
2741 name: "test-tenant".into(),
2742 ..Default::default()
2743 })
2744 .await
2745 .unwrap();
2746
2747 let dp = device_profile::create(device_profile::DeviceProfile {
2748 name: "dp".into(),
2749 tenant_id: Some(t.id),
2750 relay_params: Some(fields::RelayParams {
2751 is_relay: true,
2752 ..Default::default()
2753 }),
2754 ..Default::default()
2755 })
2756 .await
2757 .unwrap();
2758
2759 let app = application::create(application::Application {
2760 name: "test-app".into(),
2761 tenant_id: t.id,
2762 ..Default::default()
2763 })
2764 .await
2765 .unwrap();
2766
2767 let d = device::create(device::Device {
2768 dev_eui: EUI64::from_be_bytes([1, 1, 1, 1, 1, 1, 1, 1]),
2769 name: "dev".into(),
2770 application_id: app.id,
2771 device_profile_id: dp.id,
2772 ..Default::default()
2773 })
2774 .await
2775 .unwrap();
2776
2777 let ds = internal::DeviceSession {
2778 n_f_cnt_down: 10,
2779 a_f_cnt_down: 10,
2780 ..Default::default()
2781 };
2782
2783 struct Test {
2784 name: String,
2785 max_payload_size: usize,
2786 queue_items: Vec<device_queue::DeviceQueueItem>,
2787 expected_queue_item: Option<device_queue::DeviceQueueItem>,
2788 expected_ack_event: Option<integration_pb::AckEvent>,
2789 expected_log_event: Option<integration_pb::LogEvent>,
2790 }
2791
2792 let qi_id = Uuid::new_v4();
2793
2794 let tests = vec![

Callers

nothing calls this directly

Calls 14

prepareFunction · 0.85
set_mockFunction · 0.85
flush_for_dev_euiFunction · 0.85
enqueue_itemFunction · 0.85
get_region_networkFunction · 0.85
get_log_eventFunction · 0.85
get_ack_eventFunction · 0.85
unwrapMethod · 0.80
createFunction · 0.50
resetFunction · 0.50
partial_updateFunction · 0.50

Tested by

no test coverage detected