Python Forum
How to write test cases for a init function by Unit test in python?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to write test cases for a init function by Unit test in python?
#2
In a nutshell create an instance of the class and check that whatever should have been performed were in fact carried out. Check if properties were correctly set, do method return the correct values and so on.
There is no passion to be found playing small - in settling for a life that is less than the one you are capable of living.
Reply


Messages In This Thread
RE: How to write test cases for a init function by Unit test in python? - by jim2007 - Feb-24-2020, 08:53 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Class test : good way to split methods into several files paul18fr 4 525 Jan-30-2024, 11:46 AM
Last Post: Pedroski55
  Unit Testing Set Up and Use RockBlok 2 465 Jan-08-2024, 07:43 PM
Last Post: deanhystad
  How to automate loop test check on Network device jpc230 1 607 Oct-09-2023, 09:54 PM
Last Post: Larz60+
  How to test the high-score in my Python-game Pluviometer 2 611 Oct-02-2023, 06:55 PM
Last Post: deanhystad
  unittest generates multiple files for each of my test case, how do I change to 1 file zsousa 0 983 Feb-15-2023, 05:34 PM
Last Post: zsousa
  Better way to write this function SephMon 1 839 Feb-08-2023, 10:05 PM
Last Post: Gribouillis
  Presenting random test questions oradba4u 2 938 Sep-27-2022, 04:23 PM
Last Post: deanhystad
  PyRun_SimpleFile calling multiprocessing Python Class cause endless init loop Xeno 2 1,077 Sep-19-2022, 02:32 AM
Last Post: Xeno
  How to sort .csv file test log which item first fail and paint color SamLiu 24 5,117 Sep-03-2022, 07:32 AM
Last Post: Pedroski55
  Help with bleak - how to send test to BLE device? korenron 1 1,771 Aug-28-2022, 11:28 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020