|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- from cli import *
- from cli_Context import *
- from memory import *
- from memory_Context import *
-
- def cli_test_greetUser(
- ) -> str:
- c = cli_createContext()
- c = cli_greetUser(c)
- if (
- c.recentField == "outputGreeting"
- ):
- return "OK: cli_greetUser"
- #}
- return "ERR: cli_greetUser"
- #}
-
- def cli_test_selectItem(
- ) -> str:
- c = cli_createContext()
- c.cMemory = memory_createContext()
- c.input = "1"
- c = cli_selectItem(c)
- if (
- c.recentField == "cMemory" and
- c.cMemory.recentField == "selectedItems"
- ):
- return "OK: cli_selectItem"
- #}
- return "ERR: cli_selectItem"
- #}
-
- def cli_test_shouldPromptSelection(
- ) -> str:
- c = cli_createContext()
- c.cMemory = memory_createContext()
- c.input = "1"
- c = cli_selectItem(c)
- c = cli_shouldPromptSelection(c)
- if (
- c.recentField == "outputPromptSelection"
- ):
- return "OK: cli_shouldPromptSelection"
- #}
- return "ERR: cli_shouldPromptSelection"
- #}
-
- def cli_test_shouldReportIvalidItemSelection_outOfBoundsMin(
- ) -> str:
- c = cli_createContext()
- c.cMemory = memory_createContext()
- c.input = "0"
- c = cli_selectItem(c)
- c = cli_shouldReportInvalidItemSelection(c)
- if (
- c.recentField == "outputInvalidItemSelection"
- ):
- return "OK: cli_shouldReportInvalidItemSelection"
- #}
- return "ERR: cli_shouldReportInvalidItemSelection"
- #}
-
- def cli_test_showHelp_h(
- ) -> str:
- c = cli_createContext()
- c.input = "h"
- c = cli_showHelp(c)
- if (
- c.recentField == "outputHelp"
- ):
- return "OK: cli_showHelp_h"
- #}
- return "ERR: cli_showHelp_h"
- #}
-
- def cli_test_showHelp_help(
- ) -> str:
- c = cli_createContext()
- c.input = "help"
- c = cli_showHelp(c)
- if (
- c.recentField == "outputHelp"
- ):
- return "OK: cli_showHelp_help"
- #}
- return "ERR: cli_showHelp_help"
- #}
|