213 lines
5.3 KiB
Markdown
213 lines
5.3 KiB
Markdown
pytest
|
|
|
|
# Project Structure
|
|
|
|
├─ 📁 code_challenges
|
|
└─ CodeChallenge_16.py
|
|
└─ CodeChallenge_17.py
|
|
└─ CodeChallenge_15.py
|
|
└─ CodeChallenge_14.py
|
|
└─ CodeChallenge_18.py
|
|
└─ CodeChallenge_13.py
|
|
└─ CodeChallenge_12.py
|
|
└─ CodeChallenge_11.py
|
|
└─ CodeChallenge_19.py
|
|
└─ CodeChallenge_2.py
|
|
└─ CodeChallenge_10.py
|
|
└─ CodeChallenge_1.py
|
|
└─ CodeChallenge_02(Medium).py
|
|
└─ CodeChallenge_20.py
|
|
└─ CodeChallenge_4.py
|
|
└─ CodeChallenge_39.py
|
|
└─ CodeChallenge_38.py
|
|
└─ CodeChallenge_37.py
|
|
└─ CodeChallenge_36.py
|
|
└─ CodeChallenge_35.py
|
|
└─ CodeChallenge_34.py
|
|
└─ CodeChallenge_33.py
|
|
└─ CodeChallenge_32.py
|
|
└─ CodeChallenge_31.py
|
|
└─ CodeChallenge_30.py
|
|
└─ CodeChallenge_3.py
|
|
└─ CodeChallenge_29.py
|
|
└─ CodeChallenge_28.py
|
|
└─ CodeChallenge_27.py
|
|
└─ CodeChallenge_26.py
|
|
└─ CodeChallenge_25.py
|
|
└─ CodeChallenge_24.py
|
|
└─ CodeChallenge_23.py
|
|
└─ CodeChallenge_22.py
|
|
└─ CodeChallenge_21.py
|
|
└─ using_zip.py
|
|
└─ URLSuffixHash.py
|
|
└─ practice_1.py
|
|
└─ myCode_2.py
|
|
└─ myCode_1.py
|
|
└─ cylinder_max.py
|
|
└─ Code_Challenge_medium_1.py
|
|
└─ CodeChallenge_9.py
|
|
└─ CodeChallenge_8.py
|
|
└─ CodeChallenge_7.py
|
|
└─ CodeChallenge_6.py
|
|
└─ CodeChallenge_5.py
|
|
└─ class_Pet.py
|
|
└─ decorator_chaining.py
|
|
└─ decorator_add.py
|
|
└─ Context_Managers.py
|
|
└─ console_print_with_function.py
|
|
└─ concatenating_arrays.py
|
|
└─ complex_class.py
|
|
└─ flattening_arrays.py
|
|
└─ hand_utils.py
|
|
└─ Graph_Database_Simulation.py
|
|
└─ global_variables.py
|
|
└─ Gin_Rummy_Card_Game.py
|
|
└─ generators.py
|
|
└─ func_calls_func.py
|
|
└─ flexible_decorators.py
|
|
└─ ExpensiveQuerySimulation.py
|
|
└─ enhanced_decorators.py
|
|
└─ dynamic_polymorphism.py
|
|
└─ high-order_functions.py
|
|
└─ Dog.py
|
|
└─ discounted_list_prices.py
|
|
└─ digital_to_hexidecimal.py
|
|
└─ digital_to_binary.py
|
|
└─ dict_merge.py
|
|
└─ determinate_test.py
|
|
└─ determinate3x3.py
|
|
└─ determinate2x2.py
|
|
└─ items.csv
|
|
└─ default_func_parameters.py
|
|
└─ decorator_validation.py
|
|
└─ decorator_exercise.py
|
|
└─ class_user_def_context_mgr.py
|
|
└─ class_inheritance.py
|
|
└─ classes_fundamentals.py
|
|
└─ item_class.py
|
|
└─ broadcasting_arrays.py
|
|
└─ assigning_values_to_indexed_elements.py
|
|
└─ array_statistical_operations.py
|
|
└─ array_scalar_operations.py
|
|
└─ array_manipulation.py
|
|
└─ array_indexing.py
|
|
└─ array_creation_functions.py
|
|
└─ array_copying.py
|
|
└─ array_comparisons.py
|
|
└─ array_boolean_indexing.py
|
|
└─ args_and_optionals..py
|
|
└─ args_and_kargs_in_func.py
|
|
└─ animal_talk.py
|
|
└─ activations.py
|
|
└─ 5-Card_Stud_Poker_Game (Final).py
|
|
└─ kargs_in_dynamic_funcs.py
|
|
└─ 3D_array_indexing.py
|
|
└─ 2D_int_array_indexing.py
|
|
└─ 2D_array_slicing.py
|
|
└─ 2D_array_indexing.py
|
|
└─ 2D_array_boolean_indexing.py
|
|
└─ numpy_2D_matrices.py
|
|
└─ orbital.py
|
|
└─ operator_overloading.py
|
|
└─ numpy_linspace_function.py
|
|
└─ numpy_array.py
|
|
└─ non_local_variables.py
|
|
└─ packing-unpacking.txt.py
|
|
└─ neural_network_example.py
|
|
└─ nested_functions.py
|
|
└─ Neo4j_graph_database_simulation.py
|
|
└─ my_module.py
|
|
└─ MyProductClass.py
|
|
└─ MyProductClass Enhanced.py
|
|
└─ mult_with_queue.py
|
|
└─ mult_with_pool.py
|
|
└─ mult_inheritance.py
|
|
└─ packing.py
|
|
└─ mult_array.py
|
|
└─ multi_layer_network.py
|
|
└─ multi-layer-perceptron.py
|
|
└─ mult.py
|
|
└─ mro_resolution_example.py
|
|
└─ modify_global_var_in_func.py
|
|
└─ modify_data_structure.py
|
|
└─ merge_arrays.py
|
|
└─ mat_trans.py
|
|
└─ mat_flat.py
|
|
└─ matrix_transpose.py
|
|
└─ matrix_mult.py
|
|
└─ matrix_class.py
|
|
└─ playing_cards.py
|
|
└─ LRUCache.py
|
|
└─ Lists_In_Functions.py
|
|
└─ linked_list.py
|
|
└─ linear_algebra.py
|
|
└─ layers.py
|
|
└─ lambda_with_lists.py
|
|
└─ product_revenues_exercise.py
|
|
└─ python_closures.py
|
|
└─ product_class.py
|
|
└─ pop_list.py
|
|
└─ poker_class_version.py
|
|
└─ poker.py
|
|
└─ lambda_funcs_with_built-ins.py
|
|
└─ Lambda_funcs.py
|
|
└─ keyword_arguments_in_func_solution.py
|
|
└─ keyword_arguments_in_func_exercise.py
|
|
└─ keyword_arguments_in_funcs.py
|
|
└─ timing_decorator.py
|
|
└─ threshold_checker.py
|
|
└─ test_digital_to_hexidecimal.py
|
|
└─ test_.py
|
|
└─ two_numbers_sum_to_9.py
|
|
└─ test2.py
|
|
└─ test.py
|
|
└─ square_matrix_transpose.py
|
|
└─ Unit_Test.py
|
|
└─ sorting_2d_arrays.py
|
|
└─ sorted_arrays.py
|
|
└─ slicing_1D_arrays.py
|
|
└─ using_eval_function.py
|
|
└─ unpacking.py
|
|
└─ sleeping_decorator.py
|
|
└─ single_node_neural_network.py
|
|
└─ runtime_polymorphism.py
|
|
└─ RMD_Calculator.py
|
|
└─ using_kwargs.py
|
|
└─ reshape_array.py
|
|
└─ random_arrays_2.py
|
|
└─ random_arrays.py
|
|
└─ zipping_lists.py
|
|
└─ python_decorators.py
|
|
|
|
|
|
# Project Files
|
|
|
|
- d:\Python_Code\test_.py
|
|
- d:\Python_Code\my_module.py
|
|
|
|
## d:\Python_Code\test_.py
|
|
```
|
|
# test_math.py
|
|
def add(a, b):
|
|
return a + b
|
|
|
|
def test_add():
|
|
assert add(2, 3) == 5
|
|
|
|
|
|
```
|
|
|
|
## d:\Python_Code\my_module.py
|
|
```
|
|
# my_module.py
|
|
def greet(name):
|
|
return f"Hello, {name}!"
|
|
|
|
# test_my_module.py
|
|
def test_greet(mocker):
|
|
mock_greet = mocker.patch('my_module.greet', return_value="Hi!")
|
|
assert mock_greet("Alice") == "Hi!"
|
|
mock_greet.assert_called_once_with("Alice")
|
|
```
|
|
|