diff --git a/README.md b/README.md index ea8e28e..bea97d6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ -# 220-Advanced-Template -## Not for class use - Fork me! +# Python 220: online cohort April 2019 +## Class repo for grading -This is the master repo from which an instructor will use a fork to create their class assignment repo. +Links for setting up git for this class: -PLEASE do not use this for your students' assignments. +- https://uwpce-pythoncert.github.io/PythonCertDevel220/modules/lesson00/git_setup.html +- https://uwpce-pythoncert.github.io/PythonCertDevel220/modules/lesson00/git_workflow.html diff --git a/students/AlexW/test.txt b/students/AlexW/test.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/students/AlexW/test.txt @@ -0,0 +1 @@ + diff --git a/students/jesse_miller/README.md b/students/jesse_miller/README.md new file mode 100644 index 0000000..7a40bbb --- /dev/null +++ b/students/jesse_miller/README.md @@ -0,0 +1 @@ +New dir diff --git a/students/jesse_miller/lesson01/README.md b/students/jesse_miller/lesson01/README.md new file mode 100644 index 0000000..e69de29 diff --git a/students/jesse_miller/lesson01/activity/README.md b/students/jesse_miller/lesson01/activity/README.md new file mode 100755 index 0000000..af9b79d --- /dev/null +++ b/students/jesse_miller/lesson01/activity/README.md @@ -0,0 +1,32 @@ +# Calculator + +## Instructions + +Your assignment is to complete testing and linting on the calculator from the lesson videos. + +There's one new addition since the videos: I've separated the unit tests and the integration tests into two separate test files. + +## Your Goals + +1. `python -m unittest integration-test` should have no failures. Don't edit integration-test.py, edit your code to make it pass. +2. Add unit tests to unit-test.py such that `coverage run --source=calculator -m unittest unit-test; coverage report` shows 100% coverage. +3. All of the tests in unit-test.py should pass. +4. Satisfy the linter such that `pylint calculator` gives no errors and `flake8 calculator` gives no errors. See (PEP257)[https://www.python.org/dev/peps/pep-0257/] if you'd like more information about docstrings. There are quite a few docstrings to add, but for this exercise you don't need to get too creative: """ this method adds two numbers """ is sufficient. + +## Bonus goal +One of our specs for calculator says the following: + +``` +The add, subtract, multiply, and divide methods shall both: +Return the result of the operation +Enter the result of the operation back into the calculator +This makes it possible to perform the following sequences of operations: + calculator.enter_number(2) + calculator.enter_number(3) + calculator.add() # Returns 5, and now 5 is now 'in the calculator' + calculator.enter_number(1) + calculator.subtract() # Returns 4 because 5 - 1 = 4 +``` + +This feature is tested by our integration test, but it is not tested in our unit tests. Because this sequencing of operations is a defined feature of calculator, it would definitely be appropriate to test in the unit-test.CalculatorTests. Your bonus goal is to use *MagicMock* to test this method sequencing feature in isolation. Ie: without relying on the correctness of any particular operator we use to initialize our calculator. + diff --git a/students/jesse_miller/lesson01/activity/calculator/adder.py b/students/jesse_miller/lesson01/activity/calculator/adder.py new file mode 100644 index 0000000..874a057 --- /dev/null +++ b/students/jesse_miller/lesson01/activity/calculator/adder.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 +#pylint: disable=R0903 +''' +Addition module for calculator +''' + + +class Adder(): + ''' + Addition class for a more complex calculator + ''' + + @staticmethod + def calc(operand_1, operand_2): + ''' + This does the heavy lifting for adding + ''' + return operand_1 + operand_2 diff --git a/students/jesse_miller/lesson01/activity/calculator/calculator.py b/students/jesse_miller/lesson01/activity/calculator/calculator.py new file mode 100644 index 0000000..cdfecff --- /dev/null +++ b/students/jesse_miller/lesson01/activity/calculator/calculator.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python3 +''' +Our calculator +''' +from exceptions import InsufficientOperands + + +class Calculator(): + ''' + Class base for the calculator + ''' + + def __init__(self, adder, subtracter, multiplier, divider): + self.adder = adder + self.subtracter = subtracter + self.multiplier = multiplier + self.divider = divider + + self.stack = [] + + def enter_number(self, number): + ''' + What it says on the tin. Enter a number. + ''' + self.stack.insert(0, number) + + def _do_calc(self, operator): + ''' + Shortcut to operations on numbers. Keeps from having to repeat whole + functions. + ''' + try: + result = operator.calc(self.stack[1], self.stack[0]) + except IndexError: + raise InsufficientOperands + + self.stack = [result] + return result + + def add(self): + ''' + Addition method + ''' + return self._do_calc(self.adder) + + def subtract(self): + ''' + Subtraction method + ''' + return self._do_calc(self.subtracter) + + def multiply(self): + ''' + Multiplication method + ''' + return self._do_calc(self.multiplier) + + def divide(self): + ''' + Division method + ''' + return self._do_calc(self.divider) diff --git a/students/jesse_miller/lesson01/activity/calculator/divider.py b/students/jesse_miller/lesson01/activity/calculator/divider.py new file mode 100644 index 0000000..c169556 --- /dev/null +++ b/students/jesse_miller/lesson01/activity/calculator/divider.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 +''' +Division module for calculator +''' +#pylint: disable=R0903 +class Divider(): + ''' + Division class for a more complex calculator + ''' + + @staticmethod + def calc(operand_1, operand_2): + ''' + This does the heavy lifting for division + ''' + return operand_1 / operand_2 diff --git a/students/jesse_miller/lesson01/activity/calculator/exceptions.py b/students/jesse_miller/lesson01/activity/calculator/exceptions.py new file mode 100644 index 0000000..539e110 --- /dev/null +++ b/students/jesse_miller/lesson01/activity/calculator/exceptions.py @@ -0,0 +1,3 @@ +#!/usr/bin/env python3 +class InsufficientOperands(Exception): + pass diff --git a/students/jesse_miller/lesson01/activity/calculator/multiplier.py b/students/jesse_miller/lesson01/activity/calculator/multiplier.py new file mode 100644 index 0000000..f5bbd81 --- /dev/null +++ b/students/jesse_miller/lesson01/activity/calculator/multiplier.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 +''' +Multiplication module for calculator +''' +#pylint: disable=R0903 +class Multiplier(): + ''' + Multiplying class for a more complex calculator + ''' + + @staticmethod + def calc(operand_1, operand_2): + ''' + This does the heavy lifting for multiplying + ''' + return operand_1 * operand_2 diff --git a/students/jesse_miller/lesson01/activity/calculator/squarer.py b/students/jesse_miller/lesson01/activity/calculator/squarer.py new file mode 100644 index 0000000..60512f8 --- /dev/null +++ b/students/jesse_miller/lesson01/activity/calculator/squarer.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python3 +class Squarer(object): + ''' + A simple squaring function + ''' + + @staticmethod + def calc(operand): + ''' + calculating the square + ''' + #return operand**2 # OLD + #return operand**operand # BAD + return operand*operand # This should work diff --git a/students/jesse_miller/lesson01/activity/calculator/subtracter.py b/students/jesse_miller/lesson01/activity/calculator/subtracter.py new file mode 100644 index 0000000..bb5e4ef --- /dev/null +++ b/students/jesse_miller/lesson01/activity/calculator/subtracter.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 +''' +Subtraction module for calculator +''' +#pylint: disable=R0903 +class Subtracter(): + ''' + Addition class for a more complex calculator + ''' + + @staticmethod + def calc(operand_1, operand_2): + ''' + This does the heavy lifting for subtracting + ''' + return operand_1 - operand_2 diff --git a/students/jesse_miller/lesson01/activity/calculator/test.py b/students/jesse_miller/lesson01/activity/calculator/test.py new file mode 100644 index 0000000..0504b16 --- /dev/null +++ b/students/jesse_miller/lesson01/activity/calculator/test.py @@ -0,0 +1,109 @@ +#!/usr/bin/env python3 +#pylint: disable-all +from unittest import TestCase +from unittest.mock import MagicMock + +from adder import Adder +from subtracter import Subtracter +from multiplier import Multiplier +from divider import Divider +from calculator import Calculator +from exceptions import InsufficientOperands + +class AdderTests(TestCase): + def test_adding(self): + adder = Adder() + for i in range(-10, 10): + for j in range(-10, 10): + self.assertEqual(i + j, adder.calc(i, j)) + + +class SubtractorTests(TestCase): + def test_subtracting(self): + subtracter = Subtracter() + for i in range(-10, 10): + for j in range(-10, 10): + self.assertEqual(i - j, subtracter.calc(i, j)) + + +class MultiplierTests(TestCase): + def test_multiplying(self): + multiplier = Multiplier() + for i in range(-10, 10): + for j in range(-10, 10): + self.assertEqual(i * j, multiplier.calc(i, j)) + + +class DividerTests(TestCase): + def test_divider(self): + divider = Divider() + try: + for i in range(-10, 10): + for j in range(-10, 10): + self.assertEqual(i / j, divider.calc(i, j)) + except ZeroDivisionError: + return 0 + + +class CalculatorTests(TestCase): + + def setUp(self): + self.adder = Adder() + self.subtracter = Subtracter() + self.multiplier = Multiplier() + self.divider = Divider() + + self.calculator = Calculator(self.adder, self.subtracter, \ + self.multiplier, self.divider) + + + def test_insufficient_operands(self): + self.calculator.enter_number(0) + + with self.assertRaises(InsufficientOperands): + self.calculator.add() + + + def test_adder_call(self): + self.adder.calc = MagicMock(return_value=0) + + self.calculator.enter_number(1) + self.calculator.enter_number(2) + self.calculator.add() + + self.adder.calc.assert_called_with(1, 2) + + + def test_subtracter_call(self): + self.subtracter.calc = MagicMock(return_value=0) + + self.calculator.enter_number(1) + self.calculator.enter_number(2) + self.calculator.subtract() + + self.subtracter.calc.assert_called_with(1, 2) + + +class ModuleTests(TestCase): + + def test_module(self): + calculator = Calculator(Adder(), Subtracter(), Multiplier(), Divider()) + + calculator.enter_number(5) + calculator.enter_number(2) + + calculator.multiply() + + calculator.enter_number(46) + + calculator.add() + + calculator.enter_number(8) + + calculator.divide() + + calculator.enter_number(1) + + result = calculator.subtract() + + self.assertEqual(6, result) diff --git a/students/jesse_miller/lesson01/activity/squarer/squarer.py b/students/jesse_miller/lesson01/activity/squarer/squarer.py new file mode 100644 index 0000000..0d1028d --- /dev/null +++ b/students/jesse_miller/lesson01/activity/squarer/squarer.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 +''' +Squaring module for our calculator +''' +class Squarer(): + ''' + A simple squaring function + ''' + + @staticmethod + def calc(operand): + ''' + calculating the square + ''' + #return operand**2 # OLD + #return operand**operand # BAD + return operand*operand # This should work diff --git a/students/jesse_miller/lesson01/activity/squarer/test.py b/students/jesse_miller/lesson01/activity/squarer/test.py new file mode 100644 index 0000000..30d5f91 --- /dev/null +++ b/students/jesse_miller/lesson01/activity/squarer/test.py @@ -0,0 +1,41 @@ +# test.py +from squarer import Squarer + +class SquarerTest(object): + + @staticmethod + def test_positive_numbers(): + + squares # { + 1: 1, + 2: 4, + 3: 9, + 12: 144, + 100: 10000, + } + + for num, square in squares.items(): + result # Squarer.calc(num) + + if result !# square: + print("Squared {} and got {} but expected {}".format(num, result, square)) + @staticmethod + def test_negative_numbers(): + + squares # { + -1: 1, + -2: 4, + -3: 9, + -12: 144, + -100: 10000, + } + + for num, square in squares.items(): + result # Squarer.calc(num) + + if result !# square: + print("Squared {} and got {} but expected {}".format(num, result, square)) + +if __name__ ## "__main__": + SquarerTest.test_positive_numbers() + SquarerTest.test_negative_numbers() diff --git a/students/jesse_miller/lesson01/activity/squarer/test2.py b/students/jesse_miller/lesson01/activity/squarer/test2.py new file mode 100644 index 0000000..7810875 --- /dev/null +++ b/students/jesse_miller/lesson01/activity/squarer/test2.py @@ -0,0 +1,32 @@ +# test2.py +import unittest + +from squarer import Squarer + +class SquarerTest(unittest.TestCase): + + def test_positive_numbers(self): + + squares # { + 1: 1, + 2: 4, + 3: 9, + 12: 144, + 100: 10000, + } + + for num, square in squares.items(): + self.assertEqual(square, Squarer.calc(num), "Squaring {}".format(num)); + + def test_negative_numbers(self): + + squares # { + -1: 1, + -2: 4, + -3: 9, + -12: 144, + -100: 10000, + } + + for num, square in squares.items(): + self.assertEqual(square, Squarer.calc(num), "Squaring {}".format(num)); diff --git a/students/jesse_miller/lesson01/activity/test_integration.py b/students/jesse_miller/lesson01/activity/test_integration.py new file mode 100755 index 0000000..bed8216 --- /dev/null +++ b/students/jesse_miller/lesson01/activity/test_integration.py @@ -0,0 +1,35 @@ +from unittest import TestCase +from unittest.mock import MagicMock + +from calculator.adder import Adder +from calculator.subtracter import Subtracter +from calculator.multiplier import Multiplier +from calculator.divider import Divider +from calculator.calculator import Calculator +from calculator.exceptions import InsufficientOperands + + +class ModuleTests(TestCase): + + def test_module(self): + + calculator = Calculator(Adder(), Subtracter(), Multiplier(), Divider()) + + calculator.enter_number(5) + calculator.enter_number(2) + + calculator.multiply() + + calculator.enter_number(46) + + calculator.add() + + calculator.enter_number(8) + + calculator.divide() + + calculator.enter_number(1) + + result = calculator.subtract() + + self.assertEqual(6, result) diff --git a/students/jesse_miller/lesson01/activity/test_unit.py b/students/jesse_miller/lesson01/activity/test_unit.py new file mode 100755 index 0000000..059f66e --- /dev/null +++ b/students/jesse_miller/lesson01/activity/test_unit.py @@ -0,0 +1,65 @@ +from unittest import TestCase +from unittest.mock import MagicMock + +from calculator.adder import Adder +from calculator.subtracter import Subtracter +from calculator.multiplier import Multiplier +from calculator.divider import Divider +from calculator.calculator import Calculator +from calculator.exceptions import InsufficientOperands + +class AdderTests(TestCase): + + def test_adding(self): + adder = Adder() + + for i in range(-10, 10): + for j in range(-10, 10): + self.assertEqual(i + j, adder.calc(i, j)) + + +class SubtracterTests(TestCase): + + def test_subtracting(self): + subtracter = Subtracter() + + for i in range(-10, 10): + for j in range(-10, 10): + self.assertEqual(i - j, subtracter.calc(i, j)) + + +class CalculatorTests(TestCase): + + def setUp(self): + self.adder = Adder() + self.subtracter = Subtracter() + self.multiplier = Multiplier() + self.divider = Divider() + + self.calculator = Calculator(self.adder, self.subtracter, self.multiplier, self.divider) + + def test_insufficient_operands(self): + self.calculator.enter_number(0) + + with self.assertRaises(InsufficientOperands): + self.calculator.add() + + def test_adder_call(self): + self.adder.calc = MagicMock(return_value=0) + + self.calculator.enter_number(1) + self.calculator.enter_number(2) + self.calculator.add() + + self.adder.calc.assert_called_with(1, 2) + + def test_subtracter_call(self): + self.subtracter.calc = MagicMock(return_value=0) + + self.calculator.enter_number(1) + self.calculator.enter_number(2) + self.calculator.subtract() + + self.subtracter.calc.assert_called_with(1, 2) + + diff --git a/students/jesse_miller/lesson01/assignment/README.md b/students/jesse_miller/lesson01/assignment/README.md new file mode 100755 index 0000000..95e6ab3 --- /dev/null +++ b/students/jesse_miller/lesson01/assignment/README.md @@ -0,0 +1,9 @@ +Grading +======= + +For assignment 1, you will need to supply your own unit_tests.py  +and integration_test.py files. + +The assignment is graded as follows: +1. Run the student unit_tests +2. Run coverage and linting using the regular batch file. diff --git a/students/jesse_miller/lesson01/assignment/inventory_management/electric_appliances.py b/students/jesse_miller/lesson01/assignment/inventory_management/electric_appliances.py new file mode 100755 index 0000000..d666b02 --- /dev/null +++ b/students/jesse_miller/lesson01/assignment/inventory_management/electric_appliances.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python3 +''' +This class is for electric appliances +''' +from store_inventory import Inventory + + +# pylint: disable=R0903 +# pylint: disable=R0913 +class ElectricAppliances(Inventory): + ''' + Here we have the Inventory management for electric appliances, below it is + identified with product code, description, market and rental prices, brand, + and... voltage I guess. + ''' + + def __init__(self, product_code, description, market_price, rental_price, + brand, voltage): + ''' + Creates common instance variables from the parent class + ''' + Inventory.__init__(self, product_code, description, market_price, + rental_price) + + self.brand = brand + self.voltage = voltage + + def return_as_dict(self): + ''' + Here we will populate the dictionary with the current Inventory + numbers. + ''' + output_dict = {} + output_dict['product_code'] = self.product_code + output_dict['description'] = self.description + output_dict['market_price'] = self.market_price + output_dict['rental_price'] = self.rental_price + output_dict['brand'] = self.brand + output_dict['voltage'] = self.voltage + + return output_dict diff --git a/students/jesse_miller/lesson01/assignment/inventory_management/home_furniture.py b/students/jesse_miller/lesson01/assignment/inventory_management/home_furniture.py new file mode 100755 index 0000000..1ec3688 --- /dev/null +++ b/students/jesse_miller/lesson01/assignment/inventory_management/home_furniture.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python3 +''' +This is the furniture class +''' +from store_inventory import Inventory + + +# pylint: disable=R0913 +# pylint: disable=R0903 +class FurnitureClass(Inventory): + ''' + Creates common instance variables from the parent class + ''' + def __init__(self, product_code, description, market_price, rental_price, + material, size): + + Inventory.__init__(self, product_code, description, market_price, + rental_price) + + self.material = material + self.size = size + + def return_as_dict(self): + ''' + Here we will populate the dictionary with the current Inventory + numbers. + ''' + output_dict = {} + output_dict['product_code'] = self.product_code + output_dict['description'] = self.description + output_dict['market_price'] = self.market_price + output_dict['rental_price'] = self.rental_price + output_dict['material'] = self.material + output_dict['size'] = self.size + + return output_dict diff --git a/students/jesse_miller/lesson01/assignment/inventory_management/main.py b/students/jesse_miller/lesson01/assignment/inventory_management/main.py new file mode 100755 index 0000000..f7cea87 --- /dev/null +++ b/students/jesse_miller/lesson01/assignment/inventory_management/main.py @@ -0,0 +1,105 @@ +#!/usr/bin/env python3 +''' +Launches the user interface for the Inventory management system +''' +import sys +import market_prices +from store_inventory import Inventory +from home_furniture import FurnitureClass +from electric_appliances import ElectricAppliances +FULL_INVENTORY = {} +''' +I don't like globals, but right now I can't think of how to fix this. +''' + + +def main_menu(user_prompt=None): + ''' + Our main main + ''' + valid_prompts = {"1": add_new_item, + "2": item_info, + "q": exit_program} + # options = list(valid_prompts.keys()) + + while user_prompt not in valid_prompts: + # options_str = ("{}" + (", {}") * (len(options)-1)).format(*options) + print("Please choose from the following options ({options_str}):") + print("1. Add a new item to the Inventory") + print("2. Get item information") + print("q. Quit") + user_prompt = input(">") + return valid_prompts.get(user_prompt) + + +def get_price(item_code): + ''' + Prints "Get Price", otherwise doesn't seem to do anything... + ''' + # print("Get price") + latest_price = market_prices.get_latest_price(item_code) + return latest_price + + +def add_new_item(): + ''' + Here we add a new individual item + ''' + # global full_inventory + item_code = input("Enter item code: ") + item_description = input("Enter item description: ") + item_rental_price = input("Enter item rental price: ") + + # Get price from the market prices module + item_price = market_prices.get_latest_price(item_code) + + is_furniture = input("Is this item a piece of furniture? (Y/N): ") + if is_furniture.lower() == "y": + item_material = input("Enter item material: ") + item_size = input("Enter item size (S,M,L,XL): ") + new_item = FurnitureClass(item_code, item_description, item_price, + item_rental_price, item_material, item_size) + else: + is_electric_appliance = input("Is this item an electric appliance? \ + (Y/N): ") + if is_electric_appliance.lower() == "y": + item_brand = input("Enter item brand: ") + item_voltage = input("Enter item voltage: ") + new_item = ElectricAppliances(item_code, + item_description, item_price, + item_rental_price, item_brand, + item_voltage) + else: + new_item = Inventory(item_code, item_description, + item_price, item_rental_price) + FULL_INVENTORY[item_code] = new_item.return_as_dict() + print("New Inventory item added") + + +def item_info(): + ''' + This is where we enter the item information for new product + ''' + item_code = input("Enter item code: ") + if item_code in FULL_INVENTORY: + print_dict = FULL_INVENTORY[item_code] + # pylint: disable=C0103 + for k, v in print_dict.items(): + print("{}:{}".format(k, v)) + else: + print("Item not found in Inventory") + + +def exit_program(): + ''' + Gracefully exits + ''' + sys.exit() + + +if __name__ == '__main__': + # full_inventory = {} + while True: + print(FULL_INVENTORY) + main_menu()() + input("Press Enter to continue...........") diff --git a/students/jesse_miller/lesson01/assignment/inventory_management/market_prices.py b/students/jesse_miller/lesson01/assignment/inventory_management/market_prices.py new file mode 100755 index 0000000..08ddcca --- /dev/null +++ b/students/jesse_miller/lesson01/assignment/inventory_management/market_prices.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python3 +# pylint: disable=C0111 +# pylint: disable=W0613 + +def get_latest_price(item_code): + return 24 + # Raise an exception to force the user to Mock its output diff --git a/students/jesse_miller/lesson01/assignment/inventory_management/store_inventory.py b/students/jesse_miller/lesson01/assignment/inventory_management/store_inventory.py new file mode 100755 index 0000000..ac04798 --- /dev/null +++ b/students/jesse_miller/lesson01/assignment/inventory_management/store_inventory.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 +''' +This will be our inventory class +''' + + +# pylint: disable=R0903 +class Inventory: + ''' + This class will track the inventory of the products housed + ''' + + def __init__(self, product_code, description, market_price, rental_price): + self.product_code = product_code + self.description = description + self.market_price = market_price + self.rental_price = rental_price + + def return_as_dict(self): + ''' + Here we will populate the dictionary with the current inventory numbers + for all departments. + ''' + output_dict = {} + output_dict['product_code'] = self.product_code + output_dict['description'] = self.description + output_dict['market_price'] = self.market_price + output_dict['rental_price'] = self.rental_price + + return output_dict diff --git a/students/jesse_miller/lesson01/assignment/pylintrc b/students/jesse_miller/lesson01/assignment/pylintrc new file mode 100644 index 0000000..0d96a23 --- /dev/null +++ b/students/jesse_miller/lesson01/assignment/pylintrc @@ -0,0 +1,236 @@ +[MASTER] + +# Specify a configuration file. +#rcfile= + +# Python code to execute, usually for sys.path manipulation such as +# pygtk.require(). +#init-hook= + +# Profiled execution. +profile=no + +# Add to the black list. It should be a base name, not a +# path. You may set this option multiple times. +ignore=CVS + +# Pickle collected data for later comparisons. +persistent=yes + +# List of plugins (as comma separated values of python modules names) to load, +# usually to register additional checkers. +load-plugins= + + +[MESSAGES CONTROL] + +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time. +#enable= + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifier separated by comma (,) or put this option +# multiple time. +disable= too-few-public-methods, too-many-arguments + + +[REPORTS] + +# Set the output format. Available formats are text, parseable, colorized, msvs +# (visual studio) and html +output-format=text + +# Include message's id in output +include-ids=no + +# Put messages in a separate file for each module / package specified on the +# command line instead of printing them on stdout. Reports (if any) will be +# written in a file name "pylint_global.[txt|html]". +files-output=no + +# Tells whether to display a full report or only the messages +reports=yes + +# Python expression which should return a note less than 10 (10 is the highest +# note). You have access to the variables errors warning, statement which +# respectively contain the number of errors / warnings messages and the total +# number of statements analyzed. This is used by the global evaluation report +# (R0004). +evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) + +# Add a comment according to your evaluation note. This is used by the global +# evaluation report (R0004). +comment=no + + +[VARIABLES] + +# Tells whether we should check for unused import in __init__ files. +init-import=no + +# A regular expression matching names used for dummy variables (i.e. not used). +dummy-variables-rgx=_|dummy + +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid to define new builtins when possible. +additional-builtins= + + +[BASIC] + +# Required attributes for module, separated by a comma +required-attributes= + +# List of builtins function names that should not be used, separated by a comma +bad-functions=map,filter,apply,input + +# Regular expression which should only match correct module names +module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ + +# Regular expression which should only match correct module level names +const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ + +# Regular expression which should only match correct class names +class-rgx=[A-Z_][a-zA-Z0-9]+$ + +# Regular expression which should only match correct function names +function-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Regular expression which should only match correct method names +method-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Regular expression which should only match correct instance attribute names +attr-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Regular expression which should only match correct argument names +argument-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Regular expression which should only match correct variable names +variable-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Regular expression which should only match correct list comprehension / +# generator expression variable names +inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ + +# Good variable names which should always be accepted, separated by a comma +good-names=i,j,k,ex,Run,_ + +# Bad variable names which should always be refused, separated by a comma +bad-names=foo,bar,baz,toto,tutu,tata + +# Regular expression which should only match functions or classes name which do +# not require a docstring +no-docstring-rgx=__.*__ + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +notes=FIXME,XXX,TODO + + +[FORMAT] + +# Maximum number of characters on a single line. +max-line-length=80 + +# Maximum number of lines in a module +max-module-lines=1000 + +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string=' ' + + +[SIMILARITIES] + +# Minimum lines number of a similarity. +min-similarity-lines=4 + +# Ignore comments when computing similarities. +ignore-comments=yes + +# Ignore docstrings when computing similarities. +ignore-docstrings=yes + + +[TYPECHECK] + +# Tells whether missing members accessed in mixin class should be ignored. A +# mixin class is detected if its name ends with "mixin" (case insensitive). +ignore-mixin-members=yes + +# List of classes names for which member attributes should not be checked +# (useful for classes with attributes dynamically set). +ignored-classes=SQLObject + +# When zope mode is activated, add a predefined set of Zope acquired attributes +# to generated-members. +zope=no + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E0201 when accessed. +generated-members=REQUEST,acl_users,aq_parent + + +[DESIGN] + +# Maximum number of arguments for function / method +max-args=5 + +# Argument names that match this expression will be ignored. Default to name +# with leading underscore +ignored-argument-names=_.* + +# Maximum number of locals for function / method body +max-locals=15 + +# Maximum number of return / yield for function / method body +max-returns=6 + +# Maximum number of branch for function / method body +max-branchs=12 + +# Maximum number of statements in function / method body +max-statements=50 + +# Maximum number of parents for a class (see R0901). +max-parents=7 + +# Maximum number of attributes for a class (see R0902). +max-attributes=7 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=2 + +# Maximum number of public methods for a class (see R0904). +max-public-methods=20 + + +[IMPORTS] + +# Deprecated modules which should not be used, separated by a comma +deprecated-modules=regsub,string,TERMIOS,Bastion,rexec + +# Create a graph of every (i.e. internal and external) dependencies in the +# given file (report RP0402 must not be disabled) +import-graph= + +# Create a graph of external dependencies in the given file (report RP0402 must +# not be disabled) +ext-import-graph= + +# Create a graph of internal dependencies in the given file (report RP0402 must +# not be disabled) +int-import-graph= + + +[CLASSES] + +# List of interface methods to ignore, separated by a comma. This is used for +# instance to not check methods defines in Zope's Interface base class. +ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__,__new__,setUp diff --git a/students/jesse_miller/lesson01/assignment/tests/README.md b/students/jesse_miller/lesson01/assignment/tests/README.md new file mode 100644 index 0000000..48cdce8 --- /dev/null +++ b/students/jesse_miller/lesson01/assignment/tests/README.md @@ -0,0 +1 @@ +placeholder