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

Function test_application

chirpstack/src/storage/application.rs:758–862  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

756
757 #[tokio::test]
758 async fn test_application() {
759 let _guard = test::prepare().await;
760 let mut app = create_application(None).await;
761
762 // get
763 let app_get = get(&app.id).await.unwrap();
764 assert_eq!(app, app_get);
765
766 // update
767 app.name = "update application".into();
768 app = update(app).await.unwrap();
769 let app_get = get(&app.id).await.unwrap();
770 assert_eq!(app, app_get);
771
772 // get count and list
773 let tests = vec![
774 FilterTest {
775 filters: Filters {
776 user_id: None,
777 tenant_id: None,
778 search: None,
779 },
780 apps: vec![&app],
781 count: 1,
782 limit: 10,
783 offset: 0,
784 },
785 FilterTest {
786 filters: Filters {
787 user_id: None,
788 tenant_id: None,
789 search: Some("aap".into()),
790 },
791 apps: vec![],
792 count: 0,
793 limit: 10,
794 offset: 0,
795 },
796 FilterTest {
797 filters: Filters {
798 user_id: None,
799 tenant_id: None,
800 search: Some("app".into()),
801 },
802 apps: vec![&app],
803 count: 1,
804 limit: 10,
805 offset: 0,
806 },
807 FilterTest {
808 filters: Filters {
809 user_id: None,
810 tenant_id: None,
811 search: Some("app".into()),
812 },
813 apps: vec![],
814 count: 1,
815 limit: 0,

Callers

nothing calls this directly

Calls 9

prepareFunction · 0.85
create_applicationFunction · 0.85
unwrapMethod · 0.80
getFunction · 0.70
updateFunction · 0.70
get_countFunction · 0.70
listFunction · 0.70
deleteFunction · 0.70
intoMethod · 0.45

Tested by

no test coverage detected