From cf3cd99165d42c562f23affddf18f51212d0ba6a Mon Sep 17 00:00:00 2001 From: Ashok Bakthavathsalam Date: Sun, 19 Jun 2022 11:48:38 +0530 Subject: [PATCH 1/3] Delete conftest.py --- conftest.py | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 conftest.py diff --git a/conftest.py b/conftest.py deleted file mode 100644 index eb707b2..0000000 --- a/conftest.py +++ /dev/null @@ -1,8 +0,0 @@ -''' -import pytest - -@pytest.fixture -def input_value(): - input = 39 - return input -''' From 66d9e5e01d0b5e06bd631f1bd3cefdd61d0c4592 Mon Sep 17 00:00:00 2001 From: Ashok Bakthavathsalam Date: Sun, 19 Jun 2022 11:57:49 +0530 Subject: [PATCH 2/3] Create conftest.py --- conftest.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 conftest.py diff --git a/conftest.py b/conftest.py new file mode 100644 index 0000000..71652fa --- /dev/null +++ b/conftest.py @@ -0,0 +1,11 @@ +# Included this file at the root level for future testing scenarios +# as per https://stackoverflow.com/a/34520971/307454 +# sample fixture code provided below +""" +import pytest + +@pytest.fixture +def input_value(): + input = 39 + return input +""" From f09e34a555a33a7dfdc8bff75a43c2c81b4536f8 Mon Sep 17 00:00:00 2001 From: Ashok Bakthavathsalam Date: Sun, 19 Jun 2022 18:51:07 +0530 Subject: [PATCH 3/3] docstrings added for functions (#98) Fixed #97 --- first_timers/run.py | 4 ++++ tests/test_basic.py | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/first_timers/run.py b/first_timers/run.py index 68aa28a..66178bf 100644 --- a/first_timers/run.py +++ b/first_timers/run.py @@ -35,6 +35,10 @@ def updateDB(all_issues, db_path): is_flag=True, help='Run in debug mode (does not tweet).') def run(only_save, db_path, create, creds_path, debug): + """The function that gets repetitively called via cron. + - Updates the DB file with new issues + - Sends out corresponding tweets for those new issues + """ dbExists = os.path.exists(db_path) if not dbExists and not create: click.secho('DB file does not exist and argument' diff --git a/tests/test_basic.py b/tests/test_basic.py index 570eb51..1cf744e 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -13,7 +13,6 @@ def test_fetcher(): """Test whether first_timer_issues are getting picked up.""" issue_label = ('good first issue') new_issues = first_timers.get_first_timer_issues(issue_label) - assert new_issues @@ -27,6 +26,10 @@ def test_get_fresh(): def test_humanize_url(): + """Test whether the humanization of api endpoint works. + Please see https://en.wikipedia.org/wiki/URI_normalization + """ + api_url = "https://api.github.com/repos/tidusjar/NZBDash/issues/53" human_url = 'https://github.com/tidusjar/NZBDash/issues/53' assert first_timers.humanize_url(api_url) == human_url