You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
seeking guidance on how to mock screen at 1 and 2 so that we can unit test. is it possible to set whole screen text as internal state to tnz/ati so that i can extract multiple fields.
def extract_data(input):
ati = Ati()
try:
ati.set("TRACE", "ALL") # Turn tracing on
ati.set("LOGDEST", "demo.log") # Log file name
ati.set("DISPLAY", "HOST") # HOST screens will be logged
ati.set("SESSION_HOST", "999.999.999.999")
ati.set("SESSION_PORT", "23")
ati.set("SESSION", "A")
ati.wait(5)
ati.send("logon applid=jdoe")
ati.wait(1)
ati.send("PROG1[enter]")
ati.wait(lambda : ati.scrhas("MAIN SCREEN")) ## i would like to mock this #####1
field1= ati.extract(50, (23,5))
field2= ati.extract(51, (23,5))
:
:
: more fields on main screen
ati.send("MENU1[enter]")
ati.wait(lambda : ati.scrhas("MENU 1 SCREEN")) ## i would like to mock this #####2
field3= ati.extract(22, (23,5))
field4= ati.extract(23, (23,5))
:
:
return {"a": feild1, "b": field2, "c": field3, "d": field4}
finally:
## ati.send("[pa2]") # alt-home to logoff
ati.drop("SESSION")
return {}
}
The text was updated successfully, but these errors were encountered:
Check out test/test_tnz.py in this repo. It creates some mock screens to test some tnz functions. It is on the tnz level, not the ati level, but couldn use ati.get_tnz() to get the tnz object to mock up the screen and then use ati functions to validate your code. Of course, you'd have to have the ability to create some session to mock up. Unfortunately, mocking up screens in this way requires some fairly intimate knowledge of tnz and 3270 protocols.
Somewhat related to #154 ... it seems like it would be useful to record a screen in order to generate your mock screen.
Other than writing your own 3270 application/server... that's the best there is for now.
Maybe the easiest thing to be helpful would be some dummy session that isn't really connected to anything - it would just be an unprotected screen that you could use send() to write character data to it?
seeking guidance on how to mock screen at 1 and 2 so that we can unit test. is it possible to set whole screen text as internal state to tnz/ati so that i can extract multiple fields.
The text was updated successfully, but these errors were encountered: