summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLeonardo Tarla <41342687+leo8198@users.noreply.github.com>2022-08-18 11:57:45 -0300
committerGitHub <noreply@github.com>2022-08-18 16:57:45 +0200
commit760215f0a2552f37b4e9b86b02ef0632bc23d1df (patch)
tree6cc128b17c8f70a67c5ca67cb82444a0e821bdb9 /tests
parent6ba0a3a60e3ab85ec85e260fd70b3bc3770ec53c (diff)
Test code in example folder (#28)
* Unit tests for the examples using pytest Co-authored-by: Leonardo Ferreira Tarlá <leonardo.tarla@ringa.com.br>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_examples.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_examples.py b/tests/test_examples.py
new file mode 100644
index 0000000..699da18
--- /dev/null
+++ b/tests/test_examples.py
@@ -0,0 +1,11 @@
+from examples.quotes_to_scrape import main as quotes_to_scrape_main
+
+# Example 1 - Quotes to scrape
+def test_example_quotes_to_scrape():
+ '''
+ Test if the example quotes_to_scrape.py works
+ '''
+
+ assert quotes_to_scrape_main() == \
+ {'name': 'J.K. Rowling', 'born': 'July 31, 1965'}, \
+ 'Quotes to scrape example failed'