From f0e8745c54c761a9d2c114419a143409942020d0 Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Wed, 21 Sep 2022 19:52:04 -0400 Subject: [PATCH 1/4] testing critical paths --- app/calculator.py | 3 +++ app/smiles.py | 3 +++ codecov.yml | 3 +++ 3 files changed, 9 insertions(+) create mode 100644 app/smiles.py create mode 100644 codecov.yml diff --git a/app/calculator.py b/app/calculator.py index ab6c338e..53846941 100644 --- a/app/calculator.py +++ b/app/calculator.py @@ -12,3 +12,6 @@ def divide(x, y): if y == 0: return 'Cannot divide by 0' return x * 1.0 / y + + def power(x, y): + return x**y diff --git a/app/smiles.py b/app/smiles.py new file mode 100644 index 00000000..3ef702dc --- /dev/null +++ b/app/smiles.py @@ -0,0 +1,3 @@ +class Smiles: + def smiley(): + return ":)" diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..8d953169 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,3 @@ +profilling: + critical_files_paths: + - app/calculator.py From 0bbea43ab2e9821a33192f615af29cad6899293a Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Wed, 21 Sep 2022 19:56:29 -0400 Subject: [PATCH 2/4] typo --- codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codecov.yml b/codecov.yml index 8d953169..bc0959f4 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,3 +1,3 @@ -profilling: +profiling: critical_files_paths: - app/calculator.py From f5ccc6af1520c9bbc2f28b6e561848a0a78d311a Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Thu, 22 Sep 2022 11:39:27 -0400 Subject: [PATCH 3/4] fix: push zero fn --- app/calculator.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/calculator.py b/app/calculator.py index 53846941..1000f2bc 100644 --- a/app/calculator.py +++ b/app/calculator.py @@ -15,3 +15,6 @@ def divide(x, y): def power(x, y): return x**y + + def zero(): + return 0 From 4fa74251c82142ba8e5b0a372f5b1c4fff600e8b Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Thu, 22 Sep 2022 13:40:01 -0400 Subject: [PATCH 4/4] test: validated yaml --- app/calculator.py | 4 ++-- app/test_calculator.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/calculator.py b/app/calculator.py index 1000f2bc..4fbbd4fa 100644 --- a/app/calculator.py +++ b/app/calculator.py @@ -16,5 +16,5 @@ def divide(x, y): def power(x, y): return x**y - def zero(): - return 0 + def one(): + return 1 diff --git a/app/test_calculator.py b/app/test_calculator.py index 43bc650e..f5641938 100644 --- a/app/test_calculator.py +++ b/app/test_calculator.py @@ -24,7 +24,7 @@ def test_multiply(): assert Calculator.multiply(-4, 2.0) == -8.0 def test_divide(): - assert Calculator.divide(1, 2) == 0.5 + # assert Calculator.divide(1, 2) == 0.5 assert Calculator.divide(1.0, 2.0) == 0.5 assert Calculator.divide(0, 2.0) == 0 assert Calculator.divide(-4, 2.0) == -2.0 pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy