mirror of
https://github.com/ddworken/hishtory.git
synced 2024-12-23 23:39:02 +01:00
Remove a few direct DB insertions to prepare for parallel tests
This commit is contained in:
parent
638912b230
commit
f8a3552ad8
@ -1672,12 +1672,10 @@ func setupTestTui(t testing.TB, onlineStatus OnlineStatus) (shellTester, string,
|
||||
// Insert a couple hishtory entries
|
||||
db := hctx.GetDb(hctx.MakeContext())
|
||||
e1 := testutils.MakeFakeHistoryEntry("ls ~/")
|
||||
require.NoError(t, db.Create(e1).Error)
|
||||
if onlineStatus == Online {
|
||||
manuallySubmitHistoryEntry(t, userSecret, e1)
|
||||
}
|
||||
e2 := testutils.MakeFakeHistoryEntry("echo 'aaaaaa bbbb'")
|
||||
require.NoError(t, db.Create(e2).Error)
|
||||
if onlineStatus == Online {
|
||||
manuallySubmitHistoryEntry(t, userSecret, e2)
|
||||
}
|
||||
@ -1793,14 +1791,11 @@ func testTui_defaultFilter(t *testing.T) {
|
||||
// Setup
|
||||
defer testutils.BackupAndRestore(t)()
|
||||
tester, userSecret, _ := setupTestTui(t, Online)
|
||||
db := hctx.GetDb(hctx.MakeContext())
|
||||
e1 := testutils.MakeFakeHistoryEntry("exit 0")
|
||||
e1.ExitCode = 0
|
||||
require.NoError(t, db.Create(e1).Error)
|
||||
manuallySubmitHistoryEntry(t, userSecret, e1)
|
||||
e2 := testutils.MakeFakeHistoryEntry("exit 1")
|
||||
e2.ExitCode = 1
|
||||
require.NoError(t, db.Create(e2).Error)
|
||||
manuallySubmitHistoryEntry(t, userSecret, e2)
|
||||
|
||||
// Configure a default filter
|
||||
|
Loading…
Reference in New Issue
Block a user