Assemblers are used in test cases to make sure that what you created in the future will do something unexpected. You can argue that, for example, exceptions are thrown by false input.
Many times in programming, changing one thing means you need to change other pieces of code. Statements confirm that what you change does not violate the code you wrote earlier.
Exceptions are good. They are expected and processed through exceptions. You have exceptions for incorrect login and password, for example.
You can argue that with an incorrect login or password, the expected exception occurs.
The statement contains three main things. What you are testing (function name, for example, sign_in ), what is included (function parameters, i.e. {'email': ' john@example.com ', 'password': hashlib.md5('my_password')} ) , and what comes out ( assertTrue('user_name' in response, 'Expecting user_name to be in response!') ).
Exceptions are normal, logical alternatives in the code. Statements are tests to make sure logical paths are followed when they should be.
According to the python unittest framework, you can state that exceptions are thrown:
import random import unittest class TestSequenceFunctions(unittest.TestCase): def setUp(self): self.seq = range(10) def test_shuffle(self):
source share