MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / TestGetResourceFromPath

Function TestGetResourceFromPath

api/middleware/auth_test.go:570–664  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

568}
569
570func TestGetResourceFromPath(t *testing.T) {
571 tests := []struct {
572 name string
573 path string
574 expected Resource
575 }{
576 {
577 name: "Valid ledger path",
578 path: "/ledgers",
579 expected: ResourceLedgers,
580 },
581 {
582 name: "Valid accounts path with ID",
583 path: "/accounts/123",
584 expected: ResourceAccounts,
585 },
586 {
587 name: "Valid mocked account path",
588 path: "/mocked-account",
589 expected: ResourceAccounts,
590 },
591 {
592 name: "Valid transactions path",
593 path: "/transactions",
594 expected: ResourceTransactions,
595 },
596 {
597 name: "Valid identities path with ID",
598 path: "/identities/xyz",
599 expected: ResourceIdentities,
600 },
601 {
602 name: "Valid balances path",
603 path: "/balances",
604 expected: ResourceBalances,
605 },
606 {
607 name: "Valid balance-monitors path",
608 path: "/balance-monitors",
609 expected: ResourceBalanceMonitors,
610 },
611 {
612 name: "Valid hooks path",
613 path: "/hooks",
614 expected: ResourceHooks,
615 },
616 {
617 name: "Valid api-keys path",
618 path: "/api-keys",
619 expected: ResourceAPIKeys,
620 },
621 {
622 name: "Valid search path",
623 path: "/search",
624 expected: ResourceSearch,
625 },
626 {
627 name: "Valid reconciliation path",

Callers

nothing calls this directly

Calls 1

getResourceFromPathFunction · 0.85

Tested by

no test coverage detected