# -*- coding: utf-8 -*-
"""
Created on Wed Nov 24 09:53:26 2021

@author: russ


test_cmd_processor.py



"""

# not really maintained, to use may need to fix
# comment out to delete or revise and use

#def old_test():
#
#    a_string = "this is it \t and what             \n and more    . "
#    print( "------------------" )
#    print( a_string )
#    #print clean_s
#
## -------------------
#def test_clean():
#
#    test_object       = CmdProcessor(  "controller" )
#
#    a_string = "this is it \t and what             \n and more    . "
#    print( "------------------" )
#    print( a_string )
#    print( test_object.clean_string( a_string ) )
#
## -------------------
#def test_process_url():
#    """
#    unit test type function
#    """
#    test_object       = CmdProcessor(  "controller" )
#
#    # test urls
#
#    a_string = r"structables.com/id/Bandsaw-Stand-From-Scrap-Lumber/"     # not a url  invoks a search stop this
#    a_string = r"www.instructables.com/id/Bandsaw-Stand-From-Scrap-Lumber/"
#    a_string = r"http://www.instructables.com/id/Bandsaw-Stand-From-Scrap-Lumber/"
#    #a_string = r"       http://www.instructables.com/id/Bandsaw-Stand-From-Scrap-Lumber/"
#    #a_string = r"       http://www.instructables.com/id/Bandsaw-Stand-From-Scrap-Lumber/  junk at end, does what"  # junk seems to be ignored
#    # a_string = r"       http://www.instructables.com/id/Bandsaw-Stand-From-Scrap-Lumber/"
#    print( "------------------" )
#    print( a_string )
#
#    # choose a function
#    #print test_object.process_url( a_string )
#    #print test_object.process_if_url( a_string )
#
#
## -------------------
#def test_do_if_cmd():
#    """
#    unit test type function
#    check against pb style commands and if it is one execute
#    for now back in the contoller
#    why do this way ??
#    """
#
#    test_object       = CmdProcessor(  "controller" )
#
#    cmds  = [ "*>print hello world",
#              "*>url http://www.instructables.com/tag/type-id/?sort=RECENT",
#              "*>shell shell command",
#              "*>shellfish shell command",
#              r"*>text  D:\router.txt",
#              "*>shellfish shell command",
#              "*>shell shell command",
#              "*>shellfish shell command",
#              ]
#
#
#def cmd_strings_1( ):
#        strings         = [    "junk",
#                                "other cruft",
#                               "*>bat",   # mess with this for different tests
#                               "c:",
#                               "dir",
#                               r"rem high there",
#                               r"rem",
#                               r"dir       d:\*.txt" ,
#                               r"rem exit next ",
#                               r"exit",
#                               r"rem after exit end next",
#                               r"*>end",
#                               r"exit"
#                           ]
#
#        return strings
#
## ----------
#
#def test_do_if_star_bat_cmd():
#    """
#    unit test type function
#    check against pb style commands and if it is one execute
#    for now back in the controller
#    why do this way ??
#    """
#    #do_if_star_bat_cmd(self, a_string ):
#    # output is coming back here
#    import test_controller
#    a_controller    = test_controller.TestController( )
#    a_tester        = CmdProcessor( a_controller )
#
#    strings = cmd_strings_1()
#
#    a_string  =  "\n".join( strings )
#    #print( a_string )
#
#    a, b, c  = a_tester.do_if_star_bat_cmd( a_string )
#
#    print( c )
#
## -------------------
#def test_is_file_cmd():
#    """
#    unit test type function
#    check against pb style commands and if it is one execute
#    for now back in the controller
#    why do this way ??
#    """
#    #do_if_star_bat_cmd(self, a_string ):
#    # output is coming back here
#    import test_controller
#    a_controller = test_controller.TestController( )
#    a_tester        = CmdProcessor( a_controller )
#
#    strings = cmd_strings_1()
#
#    a_string  =  "\n".join( strings )
#    #print( a_string )
#    ( flag, list )   = a_tester.is_file_cmd( "*>bat", a_string )
#
#    print( flag, list )
