forked from alexaorrico/AirBnB_clone_v2
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
/
Copy pathtest_console.py
executable file
·41 lines (35 loc) · 1.52 KB
/
test_console.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/python3
"""
Contains the class TestConsoleDocs
"""
import console
import inspect
import pep8
import unittest
HBNBCommand = console.HBNBCommand
class TestConsoleDocs(unittest.TestCase):
"""Class for testing documentation of the console"""
def test_pep8_conformance_console(self):
"""Test that console.py conforms to PEP8."""
pep8s = pep8.StyleGuide(quiet=True)
result = pep8s.check_files(['console.py'])
self.assertEqual(result.total_errors, 0,
"Found code style errors (and warnings).")
def test_pep8_conformance_test_console(self):
"""Test that tests/test_console.py conforms to PEP8."""
pep8s = pep8.StyleGuide(quiet=True)
result = pep8s.check_files(['tests/test_console.py'])
self.assertEqual(result.total_errors, 0,
"Found code style errors (and warnings).")
def test_console_module_docstring(self):
"""Test for the console.py module docstring"""
self.assertIsNot(console.__doc__, None,
"console.py needs a docstring")
self.assertTrue(len(console.__doc__) >= 1,
"console.py needs a docstring")
def test_HBNBCommand_class_docstring(self):
"""Test for the HBNBCommand class docstring"""
self.assertIsNot(HBNBCommand.__doc__, None,
"HBNBCommand class needs a docstring")
self.assertTrue(len(HBNBCommand.__doc__) >= 1,
"HBNBCommand class needs a docstring")