(t *testing.T)
| 134 | } |
| 135 | |
| 136 | func TestNewBaseAppTx(t *testing.T) { |
| 137 | const testDataDir = "./pb_base_app_test_data_dir/" |
| 138 | defer os.RemoveAll(testDataDir) |
| 139 | |
| 140 | app := core.NewBaseApp(core.BaseAppConfig{ |
| 141 | DataDir: testDataDir, |
| 142 | }) |
| 143 | defer app.ResetBootstrapState() |
| 144 | |
| 145 | if err := app.Bootstrap(); err != nil { |
| 146 | t.Fatal(err) |
| 147 | } |
| 148 | |
| 149 | mustNotHaveTx := func(app core.App) { |
| 150 | if app.IsTransactional() { |
| 151 | t.Fatalf("Didn't expect the app to be transactional") |
| 152 | } |
| 153 | |
| 154 | if app.TxInfo() != nil { |
| 155 | t.Fatalf("Didn't expect the app.txInfo to be loaded") |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | mustHaveTx := func(app core.App) { |
| 160 | if !app.IsTransactional() { |
| 161 | t.Fatalf("Expected the app to be transactional") |
| 162 | } |
| 163 | |
| 164 | if app.TxInfo() == nil { |
| 165 | t.Fatalf("Expected the app.txInfo to be loaded") |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | mustNotHaveTx(app) |
| 170 | |
| 171 | app.RunInTransaction(func(txApp core.App) error { |
| 172 | mustHaveTx(txApp) |
| 173 | return nil |
| 174 | }) |
| 175 | |
| 176 | mustNotHaveTx(app) |
| 177 | } |
| 178 | |
| 179 | func TestBaseAppNewMailClient(t *testing.T) { |
| 180 | const testDataDir = "./pb_base_app_test_data_dir/" |
nothing calls this directly
no test coverage detected
searching dependent graphs…