How to use get_values method in pyresttest

Best Python code snippet using pyresttest_python

test_multiinput.py

Source:test_multiinput.py Github

copy

Full Screen

...44 not_connected.add_value(None)45 connected = testclasses.NonReplacingMultiInput().add_value.connect(t1.get_value)46 t2.set_value.connect(connected.get_values)47 for instance in (not_connected, connected):48 assert instance.get_values() == (None,)49 id1 = instance.add_value(1.0)50 assert instance.get_values() == (None, 1.0)51 instance.add_value(2.0)52 assert instance.get_values() == (None, 1.0, 2.0)53 instance.remove_value(id1)54 assert instance.get_values() == (None, 2.0)55 # replacing MultiInput56 t1 = testclasses.Simple()57 t2 = testclasses.Simple()58 t2.set_value.set_laziness(connectors.Laziness.ON_ANNOUNCE)59 not_connected = testclasses.ReplacingMultiInput()60 not_connected.add_value(None)61 connected = testclasses.ReplacingMultiInput().add_value.connect(t1.get_value)62 t2.set_value.connect(connected.get_values)63 for instance in (not_connected, connected):64 assert instance.get_values() == (None,)65 id1 = instance.add_value(10)66 assert instance.get_values() == (None, 10)67 instance.add_value(20)68 assert instance.get_values() == (None, 10, 20)69 instance.replace_value(id1, 30)70 assert instance.get_values() == (None, 30, 20)71 instance.remove_value(id1)72 assert instance.get_values() == (None, 20)73def test_non_replacing_multiinput():74 """Tests the behavior of a multi-input connector without a replace method"""75 call_logger = helper.CallLogger()76 # test without connections77 instance = testclasses.NonReplacingMultiInput(call_logger)78 assert instance.get_values() == ()79 id1 = instance.add_value(1)80 assert instance.get_values() == (1,)81 instance.add_value(2)82 assert instance.get_values() == (1, 2)83 instance.remove_value(id1)84 assert instance.get_values() == (2,)85 # test with connections86 t1 = testclasses.Simple(call_logger)87 t1.set_value(11)88 instance.add_value.connect(t1.get_value)89 t2 = testclasses.Simple(call_logger)90 t2.set_value(12)91 instance.add_value.connect(t2.get_value)92 assert instance.get_values() == (2, 11, 12)93 t1.set_value(13)94 assert instance.get_values() == (2, 12, 13)95def test_replacing_multiinput():96 """Tests the behavior of a multi-input connector with a replace method"""97 call_logger = helper.CallLogger()98 # test without connections99 instance = testclasses.ReplacingMultiInput(call_logger)100 assert instance.get_values() == ()101 id1 = instance.add_value(1)102 assert instance.get_values() == (1,)103 instance.add_value(2)104 assert instance.get_values() == (1, 2)105 instance.replace_value(id1, 3)106 assert instance.get_values() == (3, 2)107 instance.remove_value(id1)108 assert instance.get_values() == (2,)109 # test with connections110 t1 = testclasses.Simple(call_logger)111 t1.set_value(11)112 instance.add_value.connect(t1.get_value)113 t2 = testclasses.Simple(call_logger)114 t2.set_value(12)115 instance.add_value.connect(t2.get_value)116 assert instance.get_values() == (2, 11, 12)117 t1.set_value(13)118 assert instance.get_values() == (2, 13, 12)119def test_multiple_outputs():120 """Tests the behavior of a multi-input connector upon which two output connectors depend."""121 call_logger = helper.CallLogger()122 # set the processing chain123 t1 = testclasses.Simple(call_logger)124 t2 = testclasses.MultiInputMultipleOutputs(call_logger).add_value.connect(t1.get_value)125 t3 = testclasses.MultipleInputs(call_logger)126 call_logger.set_name_mapping(t1=t1, t2=t2, t3=t3)127 t3.set_value1.connect(t2.get_values)128 t3.set_value2.connect(t2.get_bools)129 call_logger.compare([])130 # check the executed methods131 t1.set_value(25.4)132 assert t3.get_values() == ((25.4,), (True,))133 call_logger.compare([(t1, "set_value", [25.4], t1), (t1, "get_value", [], 25.4), (t2, "add_value", (25.4,)),134 {((t2, "get_values", (), (25.4,)), (t3, "set_value1", ((25.4,),), t3)),135 ((t2, "get_bools", (), (True,)), (t3, "set_value2", ((True,),), t3))},136 (t3, "get_values", [], ((25.4,), (True,)))])137def test_disconnect():138 """Tests the behavior when disconnecting a multi-input connector"""139 t1 = testclasses.Simple()140 t2 = testclasses.Simple()141 t3 = testclasses.ReplacingMultiInput()142 t3.add_value.connect(t1.get_value)143 t3.add_value.connect(t2.get_value)144 t1.set_value(1.0)145 t2.set_value(2.0)146 assert t3.get_values() == (1.0, 2.0)147 t3.add_value.disconnect(t2.get_value)148 assert t3.get_values() == (1.0,)149def test_laziness_on_connect():150 """Tests the behavior of a non-lazy multi-input connector, that requests new151 data as soon as it becomes available and also when connecting an output connector152 to the multi-input connector"""153 call_logger = helper.CallLogger()154 # set up a small processing chain155 t1 = testclasses.NonReplacingMultiInput(call_logger)156 t2 = testclasses.NonLazyInputs(call_logger)157 call_logger.set_name_mapping(t1=t1, t2=t2)158 t2.add_value.set_laziness(connectors.Laziness.ON_CONNECT)159 t2.add_value.connect(t1.get_values)160 call_logger.compare([(t1, "get_values", None), (t2, "add_value", None)])161 # change a value and check that the setter is called162 call_logger.clear()163 t1.add_value(1.0)164 call_logger.compare([(t1, "add_value", [1.0]), (t1, "get_values", [], (1.0,)), (t2, "replace_value")])165 # change the input's laziness and check again166 call_logger.clear()167 t2.add_value.set_laziness(connectors.Laziness.ON_REQUEST)168 t1.add_value(2.0)169 call_logger.compare([(t1, "add_value", [2.0])])170def test_laziness_on_announce():171 """Tests the behavior of a non-lazy multi-input connector, that requests new172 data as soon as it becomes available"""173 call_logger = helper.CallLogger()174 # set up a small processing chain175 t1 = testclasses.NonReplacingMultiInput(call_logger)176 t2 = testclasses.NonLazyInputs(call_logger).add_value.connect(t1.get_values)177 call_logger.set_name_mapping(t1=t1, t2=t2)178 call_logger.compare([])179 # change a value and check that the setter is called180 t1.add_value(1.0)181 call_logger.compare([(t1, "add_value", [1.0]), (t1, "get_values", [], (1.0,)), (t2, "add_value", [(1.0,)])])182 # change the input's laziness and check again183 call_logger.clear()184 t2.add_value.set_laziness(connectors.Laziness.ON_REQUEST)185 t1.add_value(2.0)186 call_logger.compare([(t1, "add_value", [2.0])])187 # check that the set_laziness method is also available in the proxies188 call_logger.clear()189 t3 = testclasses.ReplacingMultiInput(call_logger)190 call_logger.set_name_mapping(t3=t3)191 t3.add_value.set_laziness(connectors.Laziness.ON_ANNOUNCE)192 t3.add_value.connect(t1.get_values)193 call_logger.compare([])194 t1.add_value(3.0)195 call_logger.compare([(t1, "add_value", [3.0]),196 (t1, "get_values", [], (1.0, 2.0, 3.0)),197 (t3, "add_value", [(1.0, 2.0, 3.0)])])198def test_laziness_on_notify():199 """Tests the behavior of a non-lazy multi-input connector, that requests new200 data as soon as it has been computed"""201 call_logger = helper.CallLogger()202 # set up a small processing chain203 t1 = testclasses.Simple(call_logger)204 t2 = testclasses.Simple(call_logger).set_value.connect(t1.get_value)205 t3 = testclasses.NonReplacingMultiInput(call_logger).add_value.connect(t1.get_value)206 call_logger.set_name_mapping(t1=t1, t2=t2, t3=t3)207 t3.add_value.set_laziness(connectors.Laziness.ON_NOTIFY)208 call_logger.compare([])209 # set the value210 t1.set_value(1.0)211 call_logger.compare([(t1, "set_value", [1.0], t1)])212 call_logger.clear()213 # retrieve the value through t2 and check if t3 updates itself214 assert t2.get_value() == 1.0215 call_logger.compare([(t1, "get_value", [], 1.0),216 {((t2, "set_value", (1.0,), t2), (t2, "get_value", (), 1.0)),217 ((t3, "add_value", (1.0,)),)}])218 call_logger.clear()219 assert t3.get_values() == (1.0,)220 call_logger.compare([(t3, "get_values", [], (1.0,))])221def test_condition_on_announce():222 """Tests the conditional announcement of value changes"""223 call_logger = helper.CallLogger()224 t1 = testclasses.Simple(call_logger)225 t2 = testclasses.ConditionalMultiInputAnnouncement(call_logger).add_value.connect(t1.get_value)226 t3 = testclasses.Simple(call_logger).set_value.connect(t2.get_values)227 call_logger.set_name_mapping(t1=t1, t2=t2, t3=t3)228 # test with condition == True229 call_logger.compare([])230 t1.set_value(1.0)231 assert t3.get_value() == (1.0,)232 call_logger.compare([(t1, "set_value", [1.0], t1), (t1, "get_value", [], 1.0),233 (t2, "add_value", [1.0]), (t2, "get_values", [], (1.0,)),234 (t3, "set_value", [(1.0,)], t3), (t3, "get_value", [], (1.0,))])235 # test with condition == False236 t2.condition = False237 call_logger.clear()238 t1.set_value(2.0)239 assert t3.get_value() == (1.0,)240 call_logger.compare([(t1, "set_value", [2.0], t1)])241 assert t2.get_values() == (1.0,)242 # test calling the method directly243 t2.condition = False244 call_logger.clear()245 t2.add_value(3.0)246 assert t3.get_value() == (1.0, 3.0)247 call_logger.compare([(t2, "add_value", [3.0]), (t2, "get_values", [], (1.0, 3.0)),248 (t3, "set_value", [(1.0, 3.0)], t3), (t3, "get_value", [], (1.0, 3.0))])249 # test disconnecting250 t2.condition = False251 call_logger.clear()252 t1.get_value.disconnect(t2.add_value)253 assert t3.get_value() == (3.0,)254 call_logger.compare([(t2, "remove_value"), (t2, "get_values", [], (3.0,)),255 (t3, "set_value", [(3.0,)], t3), (t3, "get_value", [], (3.0,))])256def test_condition_on_notify():257 """Tests the conditional notification of observing output connectors about value changes"""258 call_logger = helper.CallLogger()259 t1 = testclasses.Simple(call_logger)260 t2 = testclasses.ConditionalMultiInputNotification(call_logger).add_value.connect(t1.get_value)261 t3 = testclasses.Simple(call_logger).set_value.connect(t2.get_values)262 call_logger.set_name_mapping(t1=t1, t2=t2, t3=t3)263 call_logger.compare([])264 # test with condition == True265 t1.set_value(1.0)266 assert t3.get_value() == (1.0,)267 call_logger.compare([(t1, "set_value", [1.0], t1), (t1, "get_value", [], 1.0),268 (t2, "add_value", [1.0]), (t2, "get_values", [], (1.0,)),269 (t3, "set_value", [(1.0,)], t3), (t3, "get_value", [], (1.0,))])270 # test with condition == False271 t2.condition = False272 call_logger.clear()273 t1.set_value(2.0)274 assert t3.get_value() == (1.0,)275 call_logger.compare([(t1, "set_value", [2.0], t1),276 (t1, "get_value", [], 2.0),277 (t2, "replace_value")])278 assert t2.get_values() == (1.0,)279 # test calling the method directly280 t2.condition = False281 call_logger.clear()282 t2.add_value(3.0)283 assert t3.get_value() == (1.0,)284 call_logger.compare([(t2, "add_value", [3.0])])285 assert t2.get_values() == (1.0,)286 # test for an implementation detail, that specifying the value as keyword argument takes a slightly more complex code path287 data_id = t2.add_value(value=4.0)288 t2.remove_value(data_id)289 # test disconnecting290 t2.condition = False291 call_logger.clear()292 t1.get_value.disconnect(t2.add_value)293 assert t3.get_value() == (1.0,)294 call_logger.compare([(t2, "remove_value", None, t2)])295 # test changing the condition296 call_logger.clear()297 t2.set_condition(True)298 assert t3.get_value() == (3.0,) # the value from calling the method directly299 call_logger.compare([(t2, "set_condition", [True], t2), (t2, "get_values", [], (3.0,)),...

Full Screen

Full Screen

vm_triples.py

Source:vm_triples.py Github

copy

Full Screen

...14 self.y = y15 self.r = r16 def __repr__(self) -> str:17 ''' Return canonical string representation.'''18 return f'Triple{self.get_values()}'19 def __eq__(self, other) -> bool:20 ''' Comparison based on the values.'''21 x1, y1, z1 = self.get_values()22 x2, y2, z2 = other.get_values()23 return (approx_equal(x1, x2) and approx_equal(y1, y2) and 24 approx_equal(z1, z2))25 def __add__(self, other):26 '''Addition of triples, using formula on pp8 of book on Triples.'''27 x, y, r = self.get_values()28 bx, by, br = other.get_values()29 return Triple(x * bx - y * by, y * bx + x * by, r * br).reduce()30 def __sub__(self, other):31 '''Subtraction of triples, using method on pp10 of book on Triples.'''32 x, y, r = self.get_values()33 bx, by, br = other.get_values()34 return Triple(x * bx + y * by, y * bx - x * by, r * br).reduce()35 def double(self):36 '''Double angle formula, pp9 in Triple book.'''37 x, y, r = self.get_values()38 return Triple(x * x - y * y, 2 * x * y, r * r).reduce()39 def half(self):40 '''Half angle method, pp17 in Triple Book'''41 x, y, r = self.get_values()42 hx = x + r43 hy = y44 hr = sqrt(hx * hx + hy * hy)45 return Triple(hx, hy, hr).reduce()46 def get_values(self):47 '''48 Return a tuple of the attributes x, y, r.49 '''50 return (self.x, self.y, self.r)51 def is_valid(self):52 '''53 Tests for the validity of the triple.54 '''55 (x, y, r) = self.get_values()56 return approx_equal(x ** 2 + y ** 2, r ** 2)57 def base(self):58 return self.x59 def height(self):60 return self.y61 def hypotenuse(self):62 return self.r63 def cos(self):64 '''65 Cosine of the angle of the triple.66 '''67 return self.x / self.r68 def sin(self):69 '''70 Sine of the angle of the triple.71 '''72 return self.y / self.r73 def tan(self):74 '''75 Tan of the angle of the triple.76 '''77 return self.y / self.x78 def cosec(self):79 '''80 Cosec of the angle of the triple.81 '''82 return self.r / self.x83 def sec(self):84 '''85 Sec of the angle of the triple.86 '''87 return self.r / self.y88 def cot(self):89 '''90 Cot of the angle of the triple.91 '''92 return self.x / self.y93 def complimentary(self):94 '''95 Returns the complimentary triple.96 '''97 x, y, r = self.get_values()98 return Triple(y, x, r)99 def is_similar(self, other):100 ''' Test for similarity between triples.'''101 s = self.get_values()102 o = other.get_values()103 ratios = [e[0] / e[1] for e in zip(s, o)]104 return all([r == ratios[0] for r in ratios])105 def divide(self, c):106 '''Divide elements by a common factor.'''107 x, y, r = self.get_values()108 return Triple(x / c, y / c, r / c)109 def multiply(self, c):110 '''Multiply elements by a common factor.'''111 x, y, r = self.get_values()112 return Triple(x * c, y * c, r * c)113 def reduce(self):114 '''115 Reduce to the form where the first elements have no common factors.116 '''117 x, y, r = self.get_values()118 if type(x) == int and type(y) == int:119 d = gcd(x, y)120 if d > 1:121 x, y, r = x / d, y / d, r / d122 return Triple(x, y, r)123 def normalise(self):124 '''125 Normalise to the form where the radius is one.126 '''127 x, y, r = self.get_values()128 return Triple(x / r, y / r, 1)129TRIPLE_0 = Triple(1, 0, 1)130TRIPLE_90 = Triple(0, 1, 1)131TRIPLE_180 = Triple(-1, 0, 1)132TRIPLE_270 = Triple(0, -1, 1)133TRIPLE_360 = Triple(1, 0, 1)134TRIPLE_30 = Triple(sqrt(3), 1 ,2)135TRIPLE_45 = Triple(1, 1, sqrt(2))136TRIPLE_60 = Triple(1, sqrt(3) ,2)137class Quadruple:138 '''139 Class for computing with quadruples. For reference see the 140 book Triples by Kenneth Williams.141 '''142 def __init__(self, x, y, z, r):143 '''144 Initialise the attributes of a quadruple.145 '''146 self.x = x147 self.y = y148 self.z = z149 self.r = r150 def __repr__(self) -> str:151 ''' Return canonical string representation.'''152 return f'Quadruple{self.get_values()}'153 def __eq__(self, other) -> bool:154 ''' Comparison based on the values.'''155 x1, y1, z1, r1 = self.get_values()156 x2, y2, z2, r2 = other.get_values()157 return (approx_equal(x1, x2) and approx_equal(y1, y2) and 158 approx_equal(z1, z2) and approx_equal(r1, r2))159 def get_values(self):160 '''161 Return a tuple of the attributes x, y, z, r.162 '''163 return (self.x, self.y, self.z, self.r)164 def is_valid(self):165 '''166 Tests for the validity of the quadruple.167 '''168 (x, y, z, r) = self.get_values()169 return approx_equal(x ** 2 + y ** 2 + z ** 2, r ** 2)170 def get_composite_triples(self):171 '''Return a list of the four composite triples, as per diagram172 on pp 162 of the Triples book.'''173 x, y, z, r = self.get_values()174 return [175 Triple(x, sqrt(r * r - x * x) ,r), 176 Triple(y, z, sqrt(y * y + z * z)),177 Triple(x, y, sqrt(x * x + y * y)),178 Triple(sqrt(r * r - z * z), z, r)179 ]180 def reduce(self):181 '''182 Reduce to the form where the first elements have no common factors.183 '''184 x, y, z, r = self.get_values()185 if type(x) == int and type(y) == int and type(z) == int:186 d = gcd(gcd(x, y), z)187 if d > 1:188 x, y, z, r = x / d, y / d, z / d, r / d189 return Quadruple(x, y, z, r)190# as per pp164 of the Triples book191QUAD_POSX = Quadruple(1, 0, 0, 1)192QUAD_NEGX = Quadruple(-1, 0, 0, 1)193QUAD_POSY = Quadruple(0, 1, 0, 1)194QUAD_NEGY = Quadruple(0, -1, 0, 1)195QUAD_POSZ = Quadruple(0, 0, 1, 1)196QUAD_NEGZ = Quadruple(0, 0, -1, 1)197class Quintuple:198 '''199 Class for computing with quintuples. For reference see the 200 book Triples by Kenneth Williams. Required for quadruple subtraction pp164.201 '''202 def __init__(self, w, x, y, z, r):203 '''204 Initialise the attributes of a quintuple.205 '''206 self.w = w207 self.x = x208 self.y = y209 self.z = z210 self.r = r211 def __repr__(self) -> str:212 ''' Return canonical string representation.'''213 return f'Quintuple{self.get_values()}'214 def __eq__(self, other) -> bool:215 ''' Comparison based on the values.'''216 w1, x1, y1, z1, r1 = self.get_values()217 w2, x2, y2, z2, r2 = other.get_values()218 return (approx_equal(w1, w2) and approx_equal(x1, x2) and 219 approx_equal(y1, y2) and approx_equal(z1, z2) and 220 approx_equal(r1, r2))221 def get_values(self):222 '''223 Return a tuple of the attributes w, x, y, z, r.224 '''225 return (self.w, self.x, self.y, self.z, self.r)226 def is_valid(self):227 '''228 Tests for the validity of the quintuple.229 '''230 (w, x, y, z, r) = self.get_values()231 return approx_equal(w ** 2 + x ** 2 + y ** 2 + z ** 2, r ** 2)232 def reduce(self):233 '''234 Reduce to the form where the first elements have no common factors.235 '''236 w, x, y, z, r = self.get_values()237 if (type(w) == int and type(x) == int and type(y) == int and 238 type(z) == int):239 d = gcd(gcd(gcd(w, x), y), z)240 if d > 1:241 w, x, y, z, r = w / d, x / d, y / d, z / d, r / d...

Full Screen

Full Screen

calculator.py

Source:calculator.py Github

copy

Full Screen

...29 # First line frame30 self.first_line = Frame(self.kb_main_frame)31 self.first_line.pack()32 # Buttons first line33 self.b_null = Button(self.first_line, text='C', font=('Verdana', 25), width=3, command=lambda: self.get_values('clear'))34 self.b_null.pack(side=LEFT, padx=2, pady=2)35 self.b_divide = Button(self.first_line, text='/', font=('Verdana', 25), width=3, command=lambda: self.get_values('/'))36 self.b_divide.pack(side=LEFT, padx=2, pady=2)37 self.b_times = Button(self.first_line, text='*', font=('Verdana', 25), width=3, command=lambda : self.get_values('*'))38 self.b_times.pack(side=LEFT, padx=2, pady=2)39 self.b_minus = Button(self.first_line, text='-', font=('Verdana', 25), width=3, command=lambda: self.get_values('-'))40 self.b_minus.pack(side=LEFT, padx=2, pady=2)41 # Second line frame42 self.second_line = Frame(self.kb_main_frame)43 self.second_line.pack()44 # Buttons second line45 self.b_seven = Button(self.second_line, text='7', font=('Verdana', 25), width=3, command=lambda: self.get_values(7))46 self.b_seven.pack(side=LEFT, padx=2, pady=2)47 self.b_eight = Button(self.second_line, text='8', font=('Verdana', 25), width=3, command=lambda: self.get_values(8))48 self.b_eight.pack(side=LEFT, padx=2, pady=2)49 self.b_nine = Button(self.second_line, text='9', font=('Verdana', 25), width=3, command=lambda: self.get_values(9))50 self.b_nine.pack(side=LEFT, padx=2, pady=2)51 self.b_plus = Button(self.second_line, text='+', font=('Verdana', 25), width=3, command=lambda: self.get_values('+'))52 self.b_plus.pack(side=LEFT, padx=2, pady=2)53 # Third line frame54 self.third_line = Frame(self.kb_main_frame)55 self.third_line.pack()56 # Buttons third line57 self.b_four = Button(self.third_line, text='4', font=('Verdana', 25), width=3, command=lambda: self.get_values(4))58 self.b_four.pack(side=LEFT, padx=2, pady=2)59 self.b_five = Button(self.third_line, text='5', font=('Verdana', 25), width=3, command=lambda: self.get_values(5))60 self.b_five.pack(side=LEFT, padx=2, pady=2)61 self.b_six = Button(self.third_line, text='6', font=('Verdana', 25), width=3, command=lambda: self.get_values(6))62 self.b_six.pack(side=LEFT, padx=2, pady=2)63 self.b_dot = Button(self.third_line, text='.', font=('Verdana', 25), width=3, command=lambda: self.get_values('.'))64 self.b_dot.pack(side=LEFT, padx=2, pady=2)65 # Fourth line frame66 self.fourth_line = Frame(self.kb_main_frame)67 self.fourth_line.pack()68 # Buttons fourth line69 self.b_one = Button(self.fourth_line, text='1', font=('Verdana', 25), width=3, command=lambda: self.get_values(1))70 self.b_one.pack(side=LEFT, padx=2, pady=2)71 self.b_two = Button(self.fourth_line, text='2', font=('Verdana', 25), width=3, command=lambda: self.get_values(2))72 self.b_two.pack(side=LEFT, padx=2, pady=2)73 self.b_three = Button(self.fourth_line, text='3', font=('Verdana', 25), width=3, command=lambda: self.get_values(3))74 self.b_three.pack(side=LEFT, padx=2, pady=2)75 self.parentheses = Frame(self.fourth_line,)76 self.parentheses.pack(side=LEFT, padx=2, pady=2)77 self.b_p_right = Button(self.parentheses, text='(', font=('Verdana', 12), width=2, )78 self.b_p_right.pack(side=LEFT, padx=2, pady=2)79 self.b_p_left = Button(self.parentheses, text=')', font=('Verdana', 12), width=2, )80 self.b_p_left.pack(side=LEFT, padx=2, pady=2)81 # Fourth line frame82 self.fifth_line = Frame(self.kb_main_frame)83 self.fifth_line.pack()84 # Buttons fourth line85 self.b_zero = Button(self.fifth_line, text='0', font=('Verdana', 25), width=7, command=lambda: self.get_values(0))86 self.b_zero.pack(side=LEFT, padx=2, pady=2)87 # Button to calculate88 self.b_calculate = Button(self.fifth_line, text='=', font=('Verdana', 25), width=7, command=self.calculate)89 self.b_calculate.pack(side=LEFT, padx=2, pady=2)90 # Save the expression91 self.ex_cima = ''92 self.numeroembaixo = ''93 # Get all the values and concatenate them94 def get_values(self, txt):95 # If button 'C' is pressed, clear the screen96 if txt == 'clear':97 self.ex_cima = ''98 self.numeroembaixo = ''99 self.baixo.config(text='')100 self.cima.config(text='')101 else:102 if txt == '+':103 self.ex_cima += self.numeroembaixo + '+'104 self.cima.config(text=self.ex_cima)105 self.numeroembaixo = ''106 print(self.numeroembaixo)107 elif txt == '-':108 self.ex_cima += self.numeroembaixo + '-'...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run pyresttest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful