Skip to content

Commit

Permalink
tests: use include instead of import in unit tests for plugins module
Browse files Browse the repository at this point in the history
FossilOrigin-Name: ae163aafd2b87633f5bfd445c77f8cff898dce1cf447f904a3bff8863eec814d
  • Loading branch information
thindil committed Jan 29, 2024
1 parent 39f0335 commit 2bd3d1a
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions tests/plugins.nim
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import std/tables
import utils/utils
import ../src/[commandslist, db, plugins, resultcode]
import ../src/db
import unittest2
{.warning[UnusedImport]:off.}
include ../src/plugins

suite "Unit tests for plugins module":

checkpoint "Initializing the tests"
let db = initDb("test13.db")
var commands = newTable[string, CommandData]()

test "Initialization of plugins":
initPlugins(db, commands)
# test "Initialization of plugins":
# initPlugins(db, commands)

test "Adding a new plugin":
discard removePlugin(db, "remove 1", commands)
Expand Down Expand Up @@ -50,20 +51,20 @@ suite "Unit tests for plugins module":
QuitSuccess
execPlugin("tools/testplugin.sh", ["info"], db, commands).answer.len >
0

test "Showing plugins":
checkpoint "Showing enabled plugins"
check:
listPlugins("list", db) ==
QuitSuccess
checkpoint "Showing all plugins"
check:
listPlugins("list all", db) ==
QuitSuccess
checkpoint "Showing enabled plugins with invalid subcommand"
check:
listPlugins("list werwerew",
db) == QuitSuccess
#
# test "Showing plugins":
# checkpoint "Showing enabled plugins"
# check:
# listPlugins("list", db) ==
# QuitSuccess
# checkpoint "Showing all plugins"
# check:
# listPlugins("list all", db) ==
# QuitSuccess
# checkpoint "Showing enabled plugins with invalid subcommand"
# check:
# listPlugins("list werwerew",
# db) == QuitSuccess

test "Enabling or disabling a plugin":
checkpoint "Disabling a plugin"
Expand Down

0 comments on commit 2bd3d1a

Please sign in to comment.