Knowee
Questions
Features
Study Tools

All your files, classes and methods must be unit tested and be PEP 8 validated.guillaume@ubuntu:~/$ python3 -m unittest discover tests.............................................................................................................................................................................................----------------------------------------------------------------------Ran 189 tests in 13.135sOKguillaume@ubuntu:~/$Note that this is just an example. The number of tests you create can be different from the above example.Repo:GitHub repository: alx-higher_level_programmingDirectory: 0x0C-python-almost_a_circleFile: tests/

Question

All your files, classes and methods must be unit tested and be PEP 8 validated.guillaume@ubuntu:~/python3munittestdiscovertests.............................................................................................................................................................................................Ran189testsin13.135sOKguillaume@ubuntu: / python3 -m unittest discover tests.............................................................................................................................................................................................----------------------------------------------------------------------Ran 189 tests in 13.135sOKguillaume@ubuntu:~/Note that this is just an example. The number of tests you create can be different from the above example.Repo:GitHub repository: alx-higher_level_programmingDirectory: 0x0C-python-almost_a_circleFile: tests/

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

It seems like you've copied a part of a task or project description, but you haven't asked a specific question. Could you please clarify what you need help with? Are you asking how to unit test your Python files, classes, and methods? Or how to validate them against PEP 8? Or something else? Please provide more details so I can assist you better.

Similar Questions

InstructionsYou will need to create three files:Apartment.py - file containing a class definition for an Apartment objectlab06.py - file containing mergesort and other functions defined in the lab06.py section of this lab.testFile.py - file containing pytest functions testing the overall correctness of your class definitionsThere will be no starter code for this assignment, but rather the class descriptions and required methods are defined in the specification below.You should organize your lab work in its own directory. This way all files for a lab are located in a single folder. Also, this will be easy to import various files into your code using the import / from technique shown in lecture.Apartment.py classThe Apartment.py file will contain the definition of an Apartment. We will define the Apartment attributes as follows:rent - integer that represents the rent of the ApartmentmetersFromUCSB - integer that represents the Apartment’s distance, in meters, from UCSBcondition - string that represents the condition of the Apartment. This string will be one of three options: "bad", "average", or "excellent".You should write a constructor that allows the user to construct an apartment object by passing in values for all of the fields. You may assume that all attributes of the Apartment object will be defined. Therefore, there should be no default values for rent, metersFromUCSB, or condition.__init__(self, rent, metersFromUCSB, condition)In addition to your constructor, your class definition should also support “getter” methods that can receive the state of the Apartment object:getRent(self)getMetersFromUCSB(self)getCondition(self)You will also implement the methodgetApartmentDetails(self)that returns a str with all of the Apartment attributes. The string should contain all attributes in the following EXACT format (Note: There is no \n character at the end of this string):a0 = Apartment(1204, 200, "bad")print(a0.getApartmentDetails())Output(Apartment) Rent: $1204, Distance From UCSB: 200m, Condition: badLastly, your Apartment class should overload the >,<, and == operators. This will be used when finding the proper position of an Apartment in the list using the specifications in the Introduction section of this lab. In this context for example, the < operator will return True for Apartment1 < Apartment2 if Apartment1 is better than Apartment2. We reviewed operator overloading in class and the textbook does discuss overloading Python operators. You can also refer to this reference on overloading various operators as well:

RequirementsGeneralAllowed editors: vi, vim, emacsAll your files will be interpreted/compiled on Ubuntu 20.04 LTS using python3 (version 3.4.3)All your files should end with a new lineThe first line of all your files should be exactly #!/usr/bin/python3A README.md file, at the root of the folder of the project, is mandatoryYour code should use the PEP 8 style (version 1.7)You are not allowed to import any moduleAll modules and functions must be documentedAll your files must be executableTasks0. Island PerimetermandatoryCreate a function def island_perimeter(grid): that returns the perimeter of the island described in grid:grid is a list of list of integers:0 represents water1 represents landEach cell is square, with a side length of 1Cells are connected horizontally/vertically (not diagonally).grid is rectangular, with its width and height not exceeding 100The grid is completely surrounded by waterThere is only one island (or nothing).The island doesn’t have “lakes” (water inside that isn’t connected to the water surrounding the island).guillaume@ubuntu:~/0x09$ cat 0-main.py#!/usr/bin/python3"""0-main"""island_perimeter = __import__('0-island_perimeter').island_perimeterif __name__ == "__main__": grid = [ [0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0], [0, 1, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0] ] print(island_perimeter(grid))guillaume@ubuntu:~/0x09$ guillaume@ubuntu:~/0x09$ ./0-main.py12guillaume@ubuntu:~/0x09$ Repo:GitHub repository: alx-interviewDirectory: 0x09-island_perimeterFile: 0-island_perimeter.py

Python has ______ for directories and ______ for filesAmodules,packagesBfunctions,modulesCmodules,functionsDpackages,modules

7.Question 7What does PEP 8 contain?1 pointA collection of modules that users can access in their programsStylistic guidelines for programmers working in PythonSuggestions for making Python easier to learnFiles with additional functions users can use in their code

Running Test Cases...> TestCase - Trivial Case Correctness FailedRuntime ErrorYour submission stopped because of a runtime error, ex: division by zero, array index out of bounds, uncaught exception. You can try testing your code with custom input and try putting debug statements in your code.Traceback (most recent call last): File "main.py", line 269, in <module> obj = Solution()TypeError: __init__() missing 1 required positional argument: 'A'Your submission failed for the following input4 1 2 1 3The expected return value: 5Test as custom inputFinal Verdict> Wrong Answer

1/1

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.