From 5759a87f19404a2a9d417df4c389152bfbf18cb3 Mon Sep 17 00:00:00 2001 From: Awinja-Andela Date: Mon, 2 Oct 2017 12:18:17 +0300 Subject: [PATCH 01/18] added view tests files --- healthtools/tests/clinical_officer.py | 44 ++++++++++++++++++ healthtools/tests/doctor.py | 47 +++++++++++++++++++ healthtools/tests/health_facilities.py | 44 ++++++++++++++++++ healthtools/tests/nhif_inpatient.py | 46 ++++++++++++++++++ healthtools/tests/nhif_outpatient.py | 46 ++++++++++++++++++ healthtools/tests/nhif_outpatient_cs.py | 44 ++++++++++++++++++ healthtools/tests/nurse.py | 62 +++++++++++++++++++++++++ 7 files changed, 333 insertions(+) create mode 100644 healthtools/tests/clinical_officer.py create mode 100644 healthtools/tests/doctor.py create mode 100644 healthtools/tests/health_facilities.py create mode 100644 healthtools/tests/nhif_inpatient.py create mode 100644 healthtools/tests/nhif_outpatient.py create mode 100644 healthtools/tests/nhif_outpatient_cs.py create mode 100644 healthtools/tests/nurse.py diff --git a/healthtools/tests/clinical_officer.py b/healthtools/tests/clinical_officer.py new file mode 100644 index 0000000..be1aeec --- /dev/null +++ b/healthtools/tests/clinical_officer.py @@ -0,0 +1,44 @@ +import os +import inspect +import sys +currentdir = os.path.dirname(os.path.abspath( + inspect.getfile(inspect.currentframe()))) +parentdir = os.path.dirname(currentdir) +sys.path.insert(0, parentdir) +import unittest +from healthtools.manage import app + +class TestSetup(unittest.TestCase): + def setUp(self): + self.client = app.test_client() + +class TestClinicalOfficersAPIWithDoctype(TestSetup): + """ + This tests clinical officers search api with doctype + """ + def test_cos_endpoint_with_bad_query(self): + """ + This will display all the clinical officers available + """ + response = self.client.get("search/clinical-officers?q=") + self.assertIn(b"ELIKANAH KEBAGENDI OMWENGA", response.data) + + def test_cos_endpoint_gets_clinical_officers(self): + """ + This will display all the clinical officers with the name John + """ + response = self.client.get("search/clinical-officers?q=john") + self.assertIn(b"OK", response.data) + +class TestClinicalOfficersAPIWithoutDoctype(TestSetup): + """ + This tests clinical officers search api without doctype keywords are used instead + """ + def test_cos_endpoint_with_bad_query(self): + response = self.client.get("search?q=john") + self.assertIn(b'"status": "FAILED"', response.data) + + def test_cos_endpoint_gets_clinical_officers(self): + response = self.client.get("search?q=Clinical Officer John") + self.assertIn(b"OK", response.data) + self.assertIn(b'"doc_type": "clinical-officers"', response.data) \ No newline at end of file diff --git a/healthtools/tests/doctor.py b/healthtools/tests/doctor.py new file mode 100644 index 0000000..8c84edf --- /dev/null +++ b/healthtools/tests/doctor.py @@ -0,0 +1,47 @@ +import os +import inspect +import sys +currentdir = os.path.dirname(os.path.abspath( + inspect.getfile(inspect.currentframe()))) +parentdir = os.path.dirname(currentdir) +sys.path.insert(0, parentdir) +import unittest +from healthtools.manage import app + +class TestSetup(unittest.TestCase): + def setUp(self): + self.client = app.test_client() + +class TestWithDoctype(TestSetup): + """ + This tests doctors search api with defined doctype + """ + def test_doctors_endpoint_with_bad_query(self): + """ + This will display all the doctors available + """ + response = self.client.get("/search/doctors?q=") + self.assertIn(b"DR BAL RAJPREET KAUR", response.data) + + def test_doctors_endpoint_gets_doctors(self): + """ + This will display All the doctors with the name John + """ + response = self.client.get("/search/doctors?q=john") + self.assertIn(b"OK", response.data) + +class TestDoctorsAPI(TestSetup): + """ + This tests doctors search api using keywords + """ + def test_doctors_endpoint_with_bad_query(self): + response = self.client.get("search?q=john") + self.assertIn(b'"status": "FAILED"', response.data) + + def test_doctors_endpoint_gets_doctors(self): + response = self.client.get("search?q=dr john") + self.assertIn(b"OK", response.data) + self.assertIn(b' "doc_type": "doctors"', response.data) + + + diff --git a/healthtools/tests/health_facilities.py b/healthtools/tests/health_facilities.py new file mode 100644 index 0000000..4153487 --- /dev/null +++ b/healthtools/tests/health_facilities.py @@ -0,0 +1,44 @@ +import os +import inspect +import sys +currentdir = os.path.dirname(os.path.abspath( + inspect.getfile(inspect.currentframe()))) +parentdir = os.path.dirname(currentdir) +sys.path.insert(0, parentdir) +import unittest +from healthtools.manage import app +class TestSetup(unittest.TestCase): + def setUp(self): + self.client = app.test_client() + +class TestHealthFacilitiesAPIWithDoctype(TestSetup): + """ + This tests Health Facilities search api with doctype + """ + def test_hf_endpoint_with_bad_query(self): + """ + This will display all the health facilities available + """ + response = self.client.get("search/health-facilities?q=") + self.assertIn(b"Kituni Dispensary", response.data) + + def test_hf_endpoint_gets_health_facilities(self): + """ + This will display All the health facilities with the name penda + """ + response = self.client.get("search/health-facilities?q=penda") + self.assertIn(b"OK", response.data) + +class TestHealthFacilitiesAPIWithoutDoctype(TestSetup): + """ + This tests Health Facilities search api without doctype + A key word should be used for a succesfull response + """ + def test_hf_endpoint_with_bad_query(self): + response = self.client.get("search?q=penda") + self.assertIn(b'"status": "FAILED"', response.data) + + def test_hf_endpoint_gets_health_facilities(self): + response = self.client.get("search?q=hf penda") + self.assertIn(b"OK", response.data) + self.assertIn(b'"doc_type": "health-facilities"', response.data) diff --git a/healthtools/tests/nhif_inpatient.py b/healthtools/tests/nhif_inpatient.py new file mode 100644 index 0000000..99aa4f3 --- /dev/null +++ b/healthtools/tests/nhif_inpatient.py @@ -0,0 +1,46 @@ +import os +import inspect +import sys +currentdir = os.path.dirname(os.path.abspath( + inspect.getfile(inspect.currentframe()))) +parentdir = os.path.dirname(currentdir) +sys.path.insert(0, parentdir) +import unittest +from healthtools.manage import app + +class TestSetup(unittest.TestCase): + def setUp(self): + self.client = app.test_client() + +class TestNhifInpatientAPIWithDoctype(TestSetup): + """ + This tests nhif accredited inpatient hospitals search api endpoint with a defined doctype + """ + def test_nhifin_endpoint_with_bad_query(self): + """ + This will display all the nhif inpatient hospitals available + """ + response = self.client.get("/search/nhif-inpatient?q=") + self.assertIn("FAMILY HEALTH OPTIONS", response.data) + + def test_nhifin_endpoint_gets_nhif_inpatient(self): + """ + This will display All the nhif inpatient hospitals with the name edelvale + """ + response = self.client.get("/search/nhif-inpatient?q=EDELVALE") + self.assertIn("OK", response.data) + +class TestNhifInpatientAPIWithoutDoctype(TestSetup): + """ + This tests nhif inpatient api endpoint using keywords + """ + def test_nhifin_endpoint_with_bad_query(self): + response = self.client.get("search?q=EDELVALE") + self.assertIn('"status": "FAILED"', response.data) + + def test_nhifin_endpoint_gets_nhif_inpatient(self): + response = self.client.get("search?q=nhif inpatient EDELVALE") + self.assertIn("OK", response.data) + self.assertIn(' "doc_type": "nhif-inpatient"', response.data) + + diff --git a/healthtools/tests/nhif_outpatient.py b/healthtools/tests/nhif_outpatient.py new file mode 100644 index 0000000..0bb271e --- /dev/null +++ b/healthtools/tests/nhif_outpatient.py @@ -0,0 +1,46 @@ +import os +import inspect +import sys +currentdir = os.path.dirname(os.path.abspath( + inspect.getfile(inspect.currentframe()))) +parentdir = os.path.dirname(currentdir) +sys.path.insert(0, parentdir) +import unittest +from healthtools.manage import app + +class TestSetup(unittest.TestCase): + def setUp(self): + self.client = app.test_client() + +class TestNhifOutpatientAPI(TestSetup): + """ + This tests search nhif accredited outpatient hospitals search api endpoint with doctype + """ + + def test_nhifop_endpoint_with_bad_query(self): + """ + This will display all the nhif accredited outpatient hospitals available + """ + response = self.client.get("search/nhif-outpatient?q=") + self.assertIn("CANCER CARE INTERNATIONAL", response.data) + + def test_nhifop_endpoint_gets_nhif_outpatient(self): + """ + This will display all the nhif accredited outpatient hospitals with the name bristol park + """ + response = self.client.get("search/nhif-outpatient?q=bristol park") + self.assertIn("OK", response.data) + +class TestNhifOutpatientAPIWithoutDoctype(TestSetup): + """ + This tests search nhif accredited outpatient hospitals search api endpoint using keywords + """ + def test_nhifop_endpoint_with_bad_query(self): + response = self.client.get("search?q=Kenyatta") + self.assertIn('"status": "FAILED"', response.data) + + def test_nhifop_endpoint_gets_nhif_outpatient(self): + response = self.client.get("search?q=nhif Kenyatta") + self.assertIn("OK", response.data) + self.assertIn(' "doc_type": "nhif-outpatient"', response.data) + diff --git a/healthtools/tests/nhif_outpatient_cs.py b/healthtools/tests/nhif_outpatient_cs.py new file mode 100644 index 0000000..3c647f0 --- /dev/null +++ b/healthtools/tests/nhif_outpatient_cs.py @@ -0,0 +1,44 @@ +import os +import inspect +import sys +currentdir = os.path.dirname(os.path.abspath( + inspect.getfile(inspect.currentframe()))) +parentdir = os.path.dirname(currentdir) +sys.path.insert(0, parentdir) +import unittest +from healthtools.manage import app + +class TestSetup(unittest.TestCase): + def setUp(self): + self.client = app.test_client() + +class TestNhifOutpatientCSAPI(TestSetup): + """ + This tests nhif accredited cs outpatient hospitals search api endpoint with defined doctype + """ + + def test_nhifopcs_endpoint_with_bad_query(self): + """ + This will display all the hospitals offering nhif outpatient cs available + """ + response = self.client.get("search/nhif-outpatient-cs?q=") + self.assertIn("ALIF MEDICAL CENTRE", response.data) + + def test_nhifopcs_endpoint_gets_nhif_outpatient_cs(self): + """ + This will display all the hospitals offering nhif outpatient cs with the name baba dogo + """ + response = self.client.get("search/nhif-outpatient-cs?q=baba dogo") + self.assertIn("OK", response.data) + +class TestNhifOutpatientCSAPIWithoutDoctype(TestSetup): + """ + This tests nhif accredited cs outpatient hospitals search api endpoint using keyword + """ + def test_nhifopcs_endpoint_with_bad_query(self): + response = self.client.get("search?q=Kenyatta") + self.assertIn('"status": "FAILED"', response.data) + + def test_nhifopcs_endpoint_gets_nhif_outpatient_cs(self): + response = self.client.get("search?q=nhif Kenyatta") + self.assertIn("OK", response.data) \ No newline at end of file diff --git a/healthtools/tests/nurse.py b/healthtools/tests/nurse.py new file mode 100644 index 0000000..38faccd --- /dev/null +++ b/healthtools/tests/nurse.py @@ -0,0 +1,62 @@ +import os +import inspect +import sys +currentdir = os.path.dirname(os.path.abspath( + inspect.getfile(inspect.currentframe()))) +parentdir = os.path.dirname(currentdir) +sys.path.insert(0, parentdir) +import unittest +from healthtools.manage import app +from healthtools.search.nurses import get_nurses_from_nc_registry + +class TestSetup(unittest.TestCase): + def setUp(self): + self.client = app.test_client() + +class TestNurseRegistery(TestSetup): + """ + This tests nurses search api with defined doctype + """ + def test_gets_nurses_from_nc_registry(self): + nurses = get_nurses_from_nc_registry("Marie") + self.assertTrue(len(nurses) > 0) + + def test_gets_nurses_from_nc_registry_handle_inexistent_nurse(self): + nurses = get_nurses_from_nc_registry("ihoafiho39023u8") + self.assertEqual(len(nurses), 0) + self.assertIn + + +class TestNursesAPI(TestSetup): + """ + This tests nurses search api with defined doctype + """ + def test_nurses_endpoint_handles_bad_query(self): + response = self.client.get("search/nurses?q=") + self.assertIn(b'"status": "FAILED"', response.data) + + def test_nurses_endpoint_gets_nurses(self): + response = self.client.get("search/nurses?q=Marie") + self.assertIn(b"OK", response.data) + + def test_nurses_endpoint_can_retrieve_cached_result(self): + # call once + self.client.get("search/nurses?q=Marie") + # second time should retrieve cached result + response = self.client.get("search/nurses?q=Marie") + print ("-------r", response) + self.assertIn(b"X-Retrieved-From-Cache", response.headers.keys()) + +class TestNursesAPIWithoutDoctypes(TestSetup): + """ + This tests nurses search api using keywords + """ + def test_nurses_endpoint_handles_bad_query(self): + response = self.client.get("search?q=Marie") + self.assertIn(b'"status": "FAILED"', response.data) + + def test_nurses_endpoint_gets_nurses(self): + response = self.client.get("search?q=nurse Marie") + self.assertIn(b"OK", response.data) + self.assertIn(b"MARIE WANJUGU MURIGO", response.data) + From 232930fbfed028c306748d839ffe23745358a4c9 Mon Sep 17 00:00:00 2001 From: Awinja-Andela Date: Mon, 2 Oct 2017 12:40:18 +0300 Subject: [PATCH 02/18] removed print statement, modified nhif files --- healthtools/manage.py | 7 +++++++ healthtools/tests/nhif_inpatient.py | 10 +++++----- healthtools/tests/nhif_outpatient.py | 11 +++++------ healthtools/tests/nhif_outpatient_cs.py | 9 ++++----- healthtools/tests/nurse.py | 1 - 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/healthtools/manage.py b/healthtools/manage.py index 88cde81..5bee236 100644 --- a/healthtools/manage.py +++ b/healthtools/manage.py @@ -1,3 +1,10 @@ +import os +import inspect +import sys +currentdir = os.path.dirname(os.path.abspath( + inspect.getfile(inspect.currentframe()))) +parentdir = os.path.dirname(currentdir) +sys.path.insert(0, parentdir) import logging from healthtools.core import create_app diff --git a/healthtools/tests/nhif_inpatient.py b/healthtools/tests/nhif_inpatient.py index 99aa4f3..41c3bc1 100644 --- a/healthtools/tests/nhif_inpatient.py +++ b/healthtools/tests/nhif_inpatient.py @@ -21,14 +21,14 @@ def test_nhifin_endpoint_with_bad_query(self): This will display all the nhif inpatient hospitals available """ response = self.client.get("/search/nhif-inpatient?q=") - self.assertIn("FAMILY HEALTH OPTIONS", response.data) + self.assertIn(b"FAMILY HEALTH OPTIONS", response.data) def test_nhifin_endpoint_gets_nhif_inpatient(self): """ This will display All the nhif inpatient hospitals with the name edelvale """ response = self.client.get("/search/nhif-inpatient?q=EDELVALE") - self.assertIn("OK", response.data) + self.assertIn(b"OK", response.data) class TestNhifInpatientAPIWithoutDoctype(TestSetup): """ @@ -36,11 +36,11 @@ class TestNhifInpatientAPIWithoutDoctype(TestSetup): """ def test_nhifin_endpoint_with_bad_query(self): response = self.client.get("search?q=EDELVALE") - self.assertIn('"status": "FAILED"', response.data) + self.assertIn(b'"status": "FAILED"', response.data) def test_nhifin_endpoint_gets_nhif_inpatient(self): response = self.client.get("search?q=nhif inpatient EDELVALE") - self.assertIn("OK", response.data) - self.assertIn(' "doc_type": "nhif-inpatient"', response.data) + self.assertIn(b"OK", response.data) + self.assertIn(b'"doc_type": "nhif-inpatient"', response.data) diff --git a/healthtools/tests/nhif_outpatient.py b/healthtools/tests/nhif_outpatient.py index 0bb271e..d15cb26 100644 --- a/healthtools/tests/nhif_outpatient.py +++ b/healthtools/tests/nhif_outpatient.py @@ -16,20 +16,19 @@ class TestNhifOutpatientAPI(TestSetup): """ This tests search nhif accredited outpatient hospitals search api endpoint with doctype """ - def test_nhifop_endpoint_with_bad_query(self): """ This will display all the nhif accredited outpatient hospitals available """ response = self.client.get("search/nhif-outpatient?q=") - self.assertIn("CANCER CARE INTERNATIONAL", response.data) + self.assertIn(b"CANCER CARE INTERNATIONAL", response.data) def test_nhifop_endpoint_gets_nhif_outpatient(self): """ This will display all the nhif accredited outpatient hospitals with the name bristol park """ response = self.client.get("search/nhif-outpatient?q=bristol park") - self.assertIn("OK", response.data) + self.assertIn(b"OK", response.data) class TestNhifOutpatientAPIWithoutDoctype(TestSetup): """ @@ -37,10 +36,10 @@ class TestNhifOutpatientAPIWithoutDoctype(TestSetup): """ def test_nhifop_endpoint_with_bad_query(self): response = self.client.get("search?q=Kenyatta") - self.assertIn('"status": "FAILED"', response.data) + self.assertIn(b'"status": "FAILED"', response.data) def test_nhifop_endpoint_gets_nhif_outpatient(self): response = self.client.get("search?q=nhif Kenyatta") - self.assertIn("OK", response.data) - self.assertIn(' "doc_type": "nhif-outpatient"', response.data) + self.assertIn(b"OK", response.data) + self.assertIn(b'"doc_type": "nhif-outpatient"', response.data) diff --git a/healthtools/tests/nhif_outpatient_cs.py b/healthtools/tests/nhif_outpatient_cs.py index 3c647f0..4fdd503 100644 --- a/healthtools/tests/nhif_outpatient_cs.py +++ b/healthtools/tests/nhif_outpatient_cs.py @@ -16,20 +16,19 @@ class TestNhifOutpatientCSAPI(TestSetup): """ This tests nhif accredited cs outpatient hospitals search api endpoint with defined doctype """ - def test_nhifopcs_endpoint_with_bad_query(self): """ This will display all the hospitals offering nhif outpatient cs available """ response = self.client.get("search/nhif-outpatient-cs?q=") - self.assertIn("ALIF MEDICAL CENTRE", response.data) + self.assertIn(b"ALIF MEDICAL CENTRE", response.data) def test_nhifopcs_endpoint_gets_nhif_outpatient_cs(self): """ This will display all the hospitals offering nhif outpatient cs with the name baba dogo """ response = self.client.get("search/nhif-outpatient-cs?q=baba dogo") - self.assertIn("OK", response.data) + self.assertIn(b"OK", response.data) class TestNhifOutpatientCSAPIWithoutDoctype(TestSetup): """ @@ -37,8 +36,8 @@ class TestNhifOutpatientCSAPIWithoutDoctype(TestSetup): """ def test_nhifopcs_endpoint_with_bad_query(self): response = self.client.get("search?q=Kenyatta") - self.assertIn('"status": "FAILED"', response.data) + self.assertIn(b'"status": "FAILED"', response.data) def test_nhifopcs_endpoint_gets_nhif_outpatient_cs(self): response = self.client.get("search?q=nhif Kenyatta") - self.assertIn("OK", response.data) \ No newline at end of file + self.assertIn(b"OK", response.data) \ No newline at end of file diff --git a/healthtools/tests/nurse.py b/healthtools/tests/nurse.py index 38faccd..24cad54 100644 --- a/healthtools/tests/nurse.py +++ b/healthtools/tests/nurse.py @@ -44,7 +44,6 @@ def test_nurses_endpoint_can_retrieve_cached_result(self): self.client.get("search/nurses?q=Marie") # second time should retrieve cached result response = self.client.get("search/nurses?q=Marie") - print ("-------r", response) self.assertIn(b"X-Retrieved-From-Cache", response.headers.keys()) class TestNursesAPIWithoutDoctypes(TestSetup): From 2681a05b677555c6f7f92a9f1efc2dc07bd4899f Mon Sep 17 00:00:00 2001 From: Awinja-Andela Date: Wed, 4 Oct 2017 13:52:22 +0300 Subject: [PATCH 03/18] modification --- healthtools/tests.zip | Bin 0 -> 14382 bytes healthtools/tests/clinical_officer.py | 4 ++++ 2 files changed, 4 insertions(+) create mode 100644 healthtools/tests.zip diff --git a/healthtools/tests.zip b/healthtools/tests.zip new file mode 100644 index 0000000000000000000000000000000000000000..383bf4c923c7aa5c2f6a781879b05b6e015603d1 GIT binary patch literal 14382 zcmaJ|1yt3`*QHCOyIZ=uySuv^=`LxI?(R;JkZuH|Tj}l+knRtjpFWKDzjqDm!dmB? zIWzn2-~nyeCPjW1N+m4T2Mhp!NJ zbNU%fk{iy+hQ5|yp#Fp;ak|ma)6AVHog$t zlW7ABRm1KyzjoGbUNV6p0HH00P4jJa_8Y{6Riz-pHFzf{4(NFCnxLv10Z9_W6|+mP zP-yXtw_$z$l$4mJ3ZfF^MNpeQupS8$ksm6&jTm&m+>04n(H-oUJZ z{vdqG$h2D9Px*pFoT5)PGd|+m<#9Zr_*$zSnK|g_P}{gZ;W#I5 zLairp;J0-UH{}1t9O0R{jjMs4fvJ&>&Oht;^aa9%82@SieJQfc_XxWsTkO} zI+$8pQ86$-&dT6vS}`FLYGrMs|F~t?+}L1ezH=Y~hT}Bm1q$Qc2k7dijM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-WIpU{H&7h3;x z&;F#UZp9^;xu-Lnjx7`{D}teE^J~%9C71bDzy%Q@EkY!%%wOa=F83?%FF05rDe`H1 zx;BGIoLia>Z@vzXRrj#NCLk=dnhCs2Xk{^z7DG=HSc`Y67>RZz^o*}IT89?09-s)3 zi3Z3l7v&b>8Dk1r{7NpRIXHMp6z)-fN;6NXhjWmr36+k@p<$Dna%Si^wn%toxVjHb z9#`|exrS+j!E7BVJ2Y0xp2uIdv8rFn#(z?z$~)%_i7uPgXvL1=y`G zH)BrFNbVjlg0Xw36=@nkHZF^AMTWz$OHOiPjWIf9rrHKwizyd@hA?X=k?;#s2YcHW zvq};Z4#&+!jC_>*qmX7swze->W>uoYn2UI4#z!!lW3hv&(JEfMiC&bvg)w=k)DAvX zWDhrUQeh8WQ`4^Z&JiY@U58%mfU)qR&(4Vv{;XP2hFi&1kbBIT(^zHK$24jvc**IpgYSeeR@7r|B|b+&UYJnL>shY0_3)Yw+}bAb5se$( zSxFx~t1^Yt5tRE2sq3Y^VQAFiqclq|(sKt|44ldbJDYPo4|*_G?8v}ZTYE2vc>XyM zxQ&U?nmvM6@ERS19|+WY_I;`vUqWa--bws9-9K7je}?*@mwz7WNgMlI_V((RP{WVd|1;EoC}qFr@}!h~ z9^gqm_gv;e|4V?Ej}5**1N?cm{xg{$TDs@4o`f^c@3U!siS-8lZ?S$me*GEfhm7WV zpeH;%zaFCfB@iIWe+GJ1iT@et$7T8RNKe;I&%2={zeK{s{A;AYUOqtp{J4C2?*EC+ zo;S$QfAODy_rw1m@cRB``%&xt?(%szUeM!}qzxv_xH(2~{htErAv|k)nkp1HD+4lc$kIyS6%wIf0QT~U=9|ib- mujTV68q6 Date: Thu, 5 Oct 2017 16:10:07 +0300 Subject: [PATCH 04/18] changed doctor and clinical officers --- healthtools/tests/clinical_officer.py | 60 ++++++++++++++++++---- healthtools/tests/doctor.py | 73 +++++++++++++++++++++------ 2 files changed, 109 insertions(+), 24 deletions(-) diff --git a/healthtools/tests/clinical_officer.py b/healthtools/tests/clinical_officer.py index 69dcac4..0478f62 100644 --- a/healthtools/tests/clinical_officer.py +++ b/healthtools/tests/clinical_officer.py @@ -16,33 +16,75 @@ class TestClinicalOfficersAPIWithDoctype(TestSetup): """ This tests clinical officers search api with doctype """ - #happy path - def test_cos_endpoint_with_bad_query(self): + def test_cos_endpoint_without_query(self): """ - This will display all the clinical officers available + This tests running cos endpoint with valid doctype and no query """ response = self.client.get("search/clinical-officers?q=") self.assertIn(b"ELIKANAH KEBAGENDI OMWENGA", response.data) - #sad path def test_cos_endpoint_gets_clinical_officers(self): """ - This will display all the clinical officers with the name John + This tests running cos endpoint with valid doctype and query """ response = self.client.get("search/clinical-officers?q=john") self.assertIn(b"OK", response.data) + def test_cos_endpoint_with_bad_endpoint(self): + """ + This tests running an endpoint with incorrect/unavailable doctype + """ + response = self.client.get("search/clinicalofficers?q=john") + self.assertIn(b'"status": "FAILED"', response.data) + + def test_cos_endpoint_with_unavailable_query(self): + """ + This tests running cos endpoint with correct doctype but unavailable query + """ + response = self.client.get("search/clinical-officers?q=1234") + self.assertIn(b'"status": "FAILED"', response.data) + class TestClinicalOfficersAPIWithoutDoctype(TestSetup): """ - This tests clinical officers search api without doctype keywords are used instead + This tests clinical officers search api without doctype, keywords are used instead """ - def test_cos_endpoint_with_bad_query(self): + def test_cos_endpoint_without_keyword_in_query(self): response = self.client.get("search?q=john") self.assertIn(b'"status": "FAILED"', response.data) def test_cos_endpoint_gets_clinical_officers(self): - response = self.client.get("search?q=Clinical Officer John") + response = self.client.get("search?q=CO John") self.assertIn(b"OK", response.data) - self.assertIn(b'"doc_type": "clinical-officers"', response.data) \ No newline at end of file + + def test_cos_endpoint_with_unavailable_query(self): + """ + This tests running cos endpoint with correct available keyword but unavailable query + """ + response = self.client.get("search?q= CO 1234") + self.assertIn(b'"status": "FAILED"', response.data) + + + def test_cos_endpoint_with_keyword_only(self): + """ + This tests running cos endpoint with correct available keyword only + """ + response = self.client.get("search?q=CO") + self.assertIn(b'"status": "FAILED"', response.data) + + + def test_cos_endpoint_without_query(self): + """ + This tests running cos endpoint without query + """ + response = self.client.get("search?q=") + self.assertIn(b'"status": "FAILED"', response.data) + + + def test_cos_endpoint_with_nonkeyword(self): + """ + This tests running cos endpoint with a keyword that is unavailable. + """ + response = self.client.get("search?q=maji john") + self.assertIn(b'"status": "FAILED"', response.data) diff --git a/healthtools/tests/doctor.py b/healthtools/tests/doctor.py index 8c84edf..e79ea7e 100644 --- a/healthtools/tests/doctor.py +++ b/healthtools/tests/doctor.py @@ -12,36 +12,79 @@ class TestSetup(unittest.TestCase): def setUp(self): self.client = app.test_client() -class TestWithDoctype(TestSetup): +class TestDoctorsAPIWithDoctype(TestSetup): """ - This tests doctors search api with defined doctype + This tests doctors search api with doctype """ - def test_doctors_endpoint_with_bad_query(self): + + def test_doctors_endpoint_without_query(self): """ - This will display all the doctors available + This tests running doctors endpoint with valid doctype and no query """ - response = self.client.get("/search/doctors?q=") - self.assertIn(b"DR BAL RAJPREET KAUR", response.data) + response = self.client.get("search/doctors?q=") + self.assertIn(b"ELIKANAH KEBAGENDI OMWENGA", response.data) - def test_doctors_endpoint_gets_doctors(self): + + def test_doctors_endpoint_gets_clinical_officers(self): """ - This will display All the doctors with the name John + This tests running doctors endpoint with valid doctype and query """ - response = self.client.get("/search/doctors?q=john") + response = self.client.get("search/doctors?q=john") self.assertIn(b"OK", response.data) -class TestDoctorsAPI(TestSetup): + def test_doctors_endpoint_with_bad_endpoint(self): + """ + This tests running an endpoint with incorrect/unavailable doctype + """ + response = self.client.get("search/clinicalofficers?q=john") + self.assertIn(b'"status": "FAILED"', response.data) + + def test_doctors_endpoint_with_unavailable_query(self): + """ + This tests running doctors endpoint with correct doctype but unavailable query + """ + response = self.client.get("search/doctors?q=1234") + self.assertIn(b'"status": "FAILED"', response.data) + +class TestDoctorsAPIWithoutDoctype(TestSetup): """ - This tests doctors search api using keywords + This tests doctors search api without doctype, keywords are used instead """ - def test_doctors_endpoint_with_bad_query(self): + def test_doctors_endpoint_without_keyword_in_query(self): response = self.client.get("search?q=john") self.assertIn(b'"status": "FAILED"', response.data) - def test_doctors_endpoint_gets_doctors(self): - response = self.client.get("search?q=dr john") + def test_doctors_endpoint_gets_clinical_officers(self): + response = self.client.get("search?q=daktari John") self.assertIn(b"OK", response.data) - self.assertIn(b' "doc_type": "doctors"', response.data) + + def test_doctors_endpoint_with_unavailable_query(self): + """ + This tests running doctors endpoint with correct available keyword but unavailable query + """ + response = self.client.get("search?q= daktari 1234") + self.assertIn(b'"status": "FAILED"', response.data) + + def test_doctors_endpoint_with_keyword_only(self): + """ + This tests running doctors endpoint with correct available keyword only + """ + response = self.client.get("search?q=daktari") + self.assertIn(b'"status": "FAILED"', response.data) + def test_doctors_endpoint_without_query(self): + """ + This tests running doctors endpoint without query + """ + response = self.client.get("search?q=") + self.assertIn(b'"status": "FAILED"', response.data) + + + def test_doctors_endpoint_with_nonkeyword(self): + """ + This tests running doctors endpoint with a keyword that is unavailable. + """ + response = self.client.get("search?q=maji john") + self.assertIn(b'"status": "FAILED"', response.data) From 19a7e007a424e39c48e5d4f47c65d728bd298384 Mon Sep 17 00:00:00 2001 From: Awinja-Andela Date: Thu, 5 Oct 2017 16:24:28 +0300 Subject: [PATCH 05/18] added health facilitites --- healthtools/tests/doctor.py | 8 +-- healthtools/tests/health_facilities.py | 75 +++++++++++++++++++++----- 2 files changed, 65 insertions(+), 18 deletions(-) diff --git a/healthtools/tests/doctor.py b/healthtools/tests/doctor.py index e79ea7e..6e7ec6a 100644 --- a/healthtools/tests/doctor.py +++ b/healthtools/tests/doctor.py @@ -22,10 +22,10 @@ def test_doctors_endpoint_without_query(self): This tests running doctors endpoint with valid doctype and no query """ response = self.client.get("search/doctors?q=") - self.assertIn(b"ELIKANAH KEBAGENDI OMWENGA", response.data) + self.assertIn(b"DR NARAYAN VIJAYA KUMAR", response.data) - def test_doctors_endpoint_gets_clinical_officers(self): + def test_doctors_endpoint_gets_doctors(self): """ This tests running doctors endpoint with valid doctype and query """ @@ -36,7 +36,7 @@ def test_doctors_endpoint_with_bad_endpoint(self): """ This tests running an endpoint with incorrect/unavailable doctype """ - response = self.client.get("search/clinicalofficers?q=john") + response = self.client.get("search/doctor?q=john") self.assertIn(b'"status": "FAILED"', response.data) def test_doctors_endpoint_with_unavailable_query(self): @@ -54,7 +54,7 @@ def test_doctors_endpoint_without_keyword_in_query(self): response = self.client.get("search?q=john") self.assertIn(b'"status": "FAILED"', response.data) - def test_doctors_endpoint_gets_clinical_officers(self): + def test_doctors_endpoint_gets_doctors(self): response = self.client.get("search?q=daktari John") self.assertIn(b"OK", response.data) diff --git a/healthtools/tests/health_facilities.py b/healthtools/tests/health_facilities.py index 4153487..80df2db 100644 --- a/healthtools/tests/health_facilities.py +++ b/healthtools/tests/health_facilities.py @@ -1,44 +1,91 @@ import os import inspect import sys + currentdir = os.path.dirname(os.path.abspath( inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) sys.path.insert(0, parentdir) import unittest from healthtools.manage import app + + class TestSetup(unittest.TestCase): def setUp(self): self.client = app.test_client() + class TestHealthFacilitiesAPIWithDoctype(TestSetup): """ - This tests Health Facilities search api with doctype + This tests health-facilities search api with doctype """ - def test_hf_endpoint_with_bad_query(self): + + def test_health_facilities_endpoint_without_query(self): """ - This will display all the health facilities available + This tests running health-facilities endpoint with valid doctype and no query """ response = self.client.get("search/health-facilities?q=") - self.assertIn(b"Kituni Dispensary", response.data) + self.assertIn(b"Tamba Pwani", response.data) - def test_hf_endpoint_gets_health_facilities(self): + def test_health_facilities_endpoint_gets_health_facilities(self): """ - This will display All the health facilities with the name penda + This tests running health-facilities endpoint with valid doctype and query """ - response = self.client.get("search/health-facilities?q=penda") + response = self.client.get("search/health-facilities?q=eldoret") self.assertIn(b"OK", response.data) + def test_health_facilities_endpoint_with_bad_endpoint(self): + """ + This tests running an endpoint with incorrect/unavailable doctype + """ + response = self.client.get("search/healthfacilities?q=Kitale") + self.assertIn(b'"status": "FAILED"', response.data) + + def test_health_facilities_endpoint_with_unavailable_query(self): + """ + This tests running health-facilities endpoint with correct doctype but unavailable query + """ + response = self.client.get("search/health-facilities?q=1234") + self.assertIn(b'"status": "FAILED"', response.data) + + class TestHealthFacilitiesAPIWithoutDoctype(TestSetup): """ - This tests Health Facilities search api without doctype - A key word should be used for a succesfull response + This tests health-facilities search api without doctype, keywords are used instead """ - def test_hf_endpoint_with_bad_query(self): - response = self.client.get("search?q=penda") + + def test_health_facilities_endpoint_without_keyword_in_query(self): + response = self.client.get("search?q=kakamega") self.assertIn(b'"status": "FAILED"', response.data) - def test_hf_endpoint_gets_health_facilities(self): - response = self.client.get("search?q=hf penda") + def test_health_facilities_endpoint_gets_health_facilities(self): + response = self.client.get("search?q=dispensary Kilifi") self.assertIn(b"OK", response.data) - self.assertIn(b'"doc_type": "health-facilities"', response.data) + + def test_health_facilities_endpoint_with_unavailable_query(self): + """ + This tests running health-facilities endpoint with correct available keyword but unavailable query + """ + response = self.client.get("search?q=sanatorium 1234") + self.assertIn(b'"status": "FAILED"', response.data) + + def test_health_facilities_endpoint_with_keyword_only(self): + """ + This tests running health-facilities endpoint with correct available keyword only + """ + response = self.client.get("search?q=hf") + self.assertIn(b'"status": "FAILED"', response.data) + + def test_health_facilities_endpoint_without_query(self): + """ + This tests running health-facilities endpoint without query + """ + response = self.client.get("search?q=") + self.assertIn(b'"status": "FAILED"', response.data) + + def test_health_facilities_endpoint_with_nonkeyword(self): + """ + This tests running health-facilities endpoint with a keyword that is unavailable. + """ + response = self.client.get("search?q=maji Mombasa") + self.assertIn(b'"status": "FAILED"', response.data) From 08e42972b5b6cabb43e62975e06881b22c12b151 Mon Sep 17 00:00:00 2001 From: Awinja-Andela Date: Thu, 5 Oct 2017 16:32:58 +0300 Subject: [PATCH 06/18] added nhif inpatient --- healthtools/tests/nhif_inpatient.py | 73 +++++++++++++++++++++++------ 1 file changed, 59 insertions(+), 14 deletions(-) diff --git a/healthtools/tests/nhif_inpatient.py b/healthtools/tests/nhif_inpatient.py index 41c3bc1..2aa5884 100644 --- a/healthtools/tests/nhif_inpatient.py +++ b/healthtools/tests/nhif_inpatient.py @@ -1,6 +1,7 @@ import os import inspect import sys + currentdir = os.path.dirname(os.path.abspath( inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) @@ -8,39 +9,83 @@ import unittest from healthtools.manage import app + class TestSetup(unittest.TestCase): def setUp(self): self.client = app.test_client() + class TestNhifInpatientAPIWithDoctype(TestSetup): """ - This tests nhif accredited inpatient hospitals search api endpoint with a defined doctype + This tests nhif-inpatient search api with doctype """ - def test_nhifin_endpoint_with_bad_query(self): + + def test_nhif_inpatient_endpoint_without_query(self): """ - This will display all the nhif inpatient hospitals available + This tests running nhif-inpatient endpoint with valid doctype and no query """ - response = self.client.get("/search/nhif-inpatient?q=") - self.assertIn(b"FAMILY HEALTH OPTIONS", response.data) + response = self.client.get("search/nhif-inpatient?q=") + self.assertIn(b"MARIE STOPES KENYA LIMITED", response.data) - def test_nhifin_endpoint_gets_nhif_inpatient(self): + def test_nhif_inpatient_endpoint_gets_nhif_inpatient(self): """ - This will display All the nhif inpatient hospitals with the name edelvale + This tests running nhif-inpatient endpoint with valid doctype and query """ - response = self.client.get("/search/nhif-inpatient?q=EDELVALE") + response = self.client.get("search/nhif-inpatient?q=MATHARE") self.assertIn(b"OK", response.data) + def test_nhif_inpatient_endpoint_with_bad_endpoint(self): + """ + This tests running an endpoint with incorrect/unavailable doctype + """ + response = self.client.get("search/nhifinpatient?q=MATHARE") + self.assertIn(b'"status": "FAILED"', response.data) + + def test_nhif_inpatient_endpoint_with_unavailable_query(self): + """ + This tests running nhif-inpatient endpoint with correct doctype but unavailable query + """ + response = self.client.get("search/nhif-inpatient?q=1234") + self.assertIn(b'"status": "FAILED"', response.data) + + class TestNhifInpatientAPIWithoutDoctype(TestSetup): """ - This tests nhif inpatient api endpoint using keywords + This tests nhif-inpatient search api without doctype, keywords are used instead """ - def test_nhifin_endpoint_with_bad_query(self): - response = self.client.get("search?q=EDELVALE") + + def test_nhif_inpatient_endpoint_without_keyword_in_query(self): + response = self.client.get("search?q=john") self.assertIn(b'"status": "FAILED"', response.data) - def test_nhifin_endpoint_gets_nhif_inpatient(self): - response = self.client.get("search?q=nhif inpatient EDELVALE") + def test_nhif_inpatient_endpoint_gets_nhif_inpatient(self): + response = self.client.get("search?q=bima inpatient Kilifi") self.assertIn(b"OK", response.data) - self.assertIn(b'"doc_type": "nhif-inpatient"', response.data) + def test_nhif_inpatient_endpoint_with_unavailable_query(self): + """ + This tests running nhif-inpatient endpoint with correct available keyword but unavailable query + """ + response = self.client.get("search?q=inpatient insurance 1234") + self.assertIn(b'"status": "FAILED"', response.data) + + def test_nhif_inpatient_endpoint_with_keyword_only(self): + """ + This tests running nhif-inpatient endpoint with correct available keyword only + """ + response = self.client.get("search?q=inpatient insurance") + self.assertIn(b'"status": "FAILED"', response.data) + def test_nhif_inpatient_endpoint_without_query(self): + """ + This tests running nhif-inpatient endpoint without query + """ + response = self.client.get("search?q=") + self.assertIn(b'"status": "FAILED"', response.data) + + def test_nhif_inpatient_endpoint_with_nonkeyword(self): + """ + This tests running nhif-inpatient endpoint with a keyword that is unavailable. + """ + response = self.client.get("search?q=maji Kilifi") + self.assertIn(b'"status": "FAILED"', response.data) From 43da6316d6e46ee1abd51a9fb53d772bc115c4e5 Mon Sep 17 00:00:00 2001 From: Awinja-Andela Date: Thu, 5 Oct 2017 16:42:51 +0300 Subject: [PATCH 07/18] added nhif outpatient --- healthtools/tests/nhif_inpatient.py | 2 +- healthtools/tests/nhif_outpatient.py | 74 ++++++++++++++++++++++------ 2 files changed, 61 insertions(+), 15 deletions(-) diff --git a/healthtools/tests/nhif_inpatient.py b/healthtools/tests/nhif_inpatient.py index 2aa5884..043344b 100644 --- a/healthtools/tests/nhif_inpatient.py +++ b/healthtools/tests/nhif_inpatient.py @@ -55,7 +55,7 @@ class TestNhifInpatientAPIWithoutDoctype(TestSetup): """ def test_nhif_inpatient_endpoint_without_keyword_in_query(self): - response = self.client.get("search?q=john") + response = self.client.get("search?q=Kilifi") self.assertIn(b'"status": "FAILED"', response.data) def test_nhif_inpatient_endpoint_gets_nhif_inpatient(self): diff --git a/healthtools/tests/nhif_outpatient.py b/healthtools/tests/nhif_outpatient.py index d15cb26..cf10bfe 100644 --- a/healthtools/tests/nhif_outpatient.py +++ b/healthtools/tests/nhif_outpatient.py @@ -1,6 +1,7 @@ import os import inspect import sys + currentdir = os.path.dirname(os.path.abspath( inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) @@ -8,38 +9,83 @@ import unittest from healthtools.manage import app + class TestSetup(unittest.TestCase): def setUp(self): self.client = app.test_client() -class TestNhifOutpatientAPI(TestSetup): + +class TestNhifOutpatientAPIWithDoctype(TestSetup): """ - This tests search nhif accredited outpatient hospitals search api endpoint with doctype + This tests nhif-outpatient search api with doctype """ - def test_nhifop_endpoint_with_bad_query(self): + + def test_nhif_outpatient_endpoint_without_query(self): """ - This will display all the nhif accredited outpatient hospitals available + This tests running nhif-outpatient endpoint with valid doctype and no query """ response = self.client.get("search/nhif-outpatient?q=") - self.assertIn(b"CANCER CARE INTERNATIONAL", response.data) + self.assertIn(b"AMIN WOMEN'S CARE CLINIC", response.data) - def test_nhifop_endpoint_gets_nhif_outpatient(self): + def test_nhif_outpatient_endpoint_gets_nhif_outpatient(self): """ - This will display all the nhif accredited outpatient hospitals with the name bristol park + This tests running nhif-outpatient endpoint with valid doctype and query """ - response = self.client.get("search/nhif-outpatient?q=bristol park") + response = self.client.get("search/nhif-outpatient?q=BRISTOL") self.assertIn(b"OK", response.data) + def test_nhif_outpatient_endpoint_with_bad_endpoint(self): + """ + This tests running an endpoint with incorrect/unavailable doctype + """ + response = self.client.get("search/nhifoutpatient?q=BRISTOL") + self.assertIn(b'"status": "FAILED"', response.data) + + def test_nhif_outpatient_endpoint_with_unavailable_query(self): + """ + This tests running nhif-outpatient endpoint with correct doctype but unavailable query + """ + response = self.client.get("search/nhif-outpatient?q=1234") + self.assertIn(b'"status": "FAILED"', response.data) + + class TestNhifOutpatientAPIWithoutDoctype(TestSetup): """ - This tests search nhif accredited outpatient hospitals search api endpoint using keywords + This tests nhif-outpatient search api without doctype, keywords are used instead """ - def test_nhifop_endpoint_with_bad_query(self): + + def test_nhif_outpatient_endpoint_without_keyword_in_query(self): response = self.client.get("search?q=Kenyatta") self.assertIn(b'"status": "FAILED"', response.data) - def test_nhifop_endpoint_gets_nhif_outpatient(self): - response = self.client.get("search?q=nhif Kenyatta") + def test_nhif_outpatient_endpoint_gets_nhif_outpatient(self): + response = self.client.get("search?q=bima outpatient Kilifi") self.assertIn(b"OK", response.data) - self.assertIn(b'"doc_type": "nhif-outpatient"', response.data) - + + def test_nhif_outpatient_endpoint_with_unavailable_query(self): + """ + This tests running nhif-outpatient endpoint with correct available keyword but unavailable query + """ + response = self.client.get("search?q=outpatient insurance 1234") + self.assertIn(b'"status": "FAILED"', response.data) + + def test_nhif_outpatient_endpoint_with_keyword_only(self): + """ + This tests running nhif-outpatient endpoint with correct available keyword only + """ + response = self.client.get("search?q=outpatient insurance") + self.assertIn(b'"status": "FAILED"', response.data) + + def test_nhif_outpatient_endpoint_without_query(self): + """ + This tests running nhif-outpatient endpoint without query + """ + response = self.client.get("search?q=") + self.assertIn(b'"status": "FAILED"', response.data) + + def test_nhif_outpatient_endpoint_with_nonkeyword(self): + """ + This tests running nhif-outpatient endpoint with a keyword that is unavailable. + """ + response = self.client.get("search?q=maji Kilifi") + self.assertIn(b'"status": "FAILED"', response.data) From 845c9ae3048f69b6273db06ad063b2dc905b8d1e Mon Sep 17 00:00:00 2001 From: Awinja-Andela Date: Thu, 5 Oct 2017 16:46:56 +0300 Subject: [PATCH 08/18] added nhif outpatient cs --- healthtools/tests/nhif_outpatient_cs.py | 76 ++++++++++++++++++++----- 1 file changed, 62 insertions(+), 14 deletions(-) diff --git a/healthtools/tests/nhif_outpatient_cs.py b/healthtools/tests/nhif_outpatient_cs.py index 4fdd503..c0a9d18 100644 --- a/healthtools/tests/nhif_outpatient_cs.py +++ b/healthtools/tests/nhif_outpatient_cs.py @@ -1,6 +1,7 @@ import os import inspect import sys + currentdir = os.path.dirname(os.path.abspath( inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) @@ -8,36 +9,83 @@ import unittest from healthtools.manage import app + class TestSetup(unittest.TestCase): def setUp(self): self.client = app.test_client() -class TestNhifOutpatientCSAPI(TestSetup): + +class TestNhifOutpatientAPIWithDoctype(TestSetup): """ - This tests nhif accredited cs outpatient hospitals search api endpoint with defined doctype + This tests nhif-outpatient-cs search api with doctype """ - def test_nhifopcs_endpoint_with_bad_query(self): + + def test_nhif_outpatient_cs_endpoint_without_query(self): """ - This will display all the hospitals offering nhif outpatient cs available + This tests running nhif-outpatient-cs endpoint with valid doctype and no query """ response = self.client.get("search/nhif-outpatient-cs?q=") - self.assertIn(b"ALIF MEDICAL CENTRE", response.data) + self.assertIn(b"AMIN WOMEN'S CARE CLINIC", response.data) - def test_nhifopcs_endpoint_gets_nhif_outpatient_cs(self): + def test_nhif_outpatient_cs_endpoint_gets_nhif_outpatient_cs(self): """ - This will display all the hospitals offering nhif outpatient cs with the name baba dogo + This tests running nhif-outpatient-cs endpoint with valid doctype and query """ - response = self.client.get("search/nhif-outpatient-cs?q=baba dogo") + response = self.client.get("search/nhif-outpatient-cs?q=BRISTOL") self.assertIn(b"OK", response.data) -class TestNhifOutpatientCSAPIWithoutDoctype(TestSetup): + def test_nhif_outpatient_cs_endpoint_with_bad_endpoint(self): + """ + This tests running an endpoint with incorrect/unavailable doctype + """ + response = self.client.get("search/nhifoutpatient-cs?q=BRISTOL") + self.assertIn(b'"status": "FAILED"', response.data) + + def test_nhif_outpatient_cs_endpoint_with_unavailable_query(self): + """ + This tests running nhif-outpatient-cs endpoint with correct doctype but unavailable query + """ + response = self.client.get("search/nhif-outpatient-cs?q=1234") + self.assertIn(b'"status": "FAILED"', response.data) + + +class TestNhifOutpatientAPIWithoutDoctype(TestSetup): """ - This tests nhif accredited cs outpatient hospitals search api endpoint using keyword + This tests nhif-outpatient-cs search api without doctype, keywords are used instead """ - def test_nhifopcs_endpoint_with_bad_query(self): + + def test_nhif_outpatient_cs_endpoint_without_keyword_in_query(self): response = self.client.get("search?q=Kenyatta") self.assertIn(b'"status": "FAILED"', response.data) - def test_nhifopcs_endpoint_gets_nhif_outpatient_cs(self): - response = self.client.get("search?q=nhif Kenyatta") - self.assertIn(b"OK", response.data) \ No newline at end of file + def test_nhif_outpatient_cs_endpoint_gets_nhif_outpatient_cs(self): + response = self.client.get("search?q=bima outpatient-cs Kilifi") + self.assertIn(b"OK", response.data) + + def test_nhif_outpatient_cs_endpoint_with_unavailable_query(self): + """ + This tests running nhif-outpatient-cs endpoint with correct available keyword but unavailable query + """ + response = self.client.get("search?q=outpatient-cs insurance 1234") + self.assertIn(b'"status": "FAILED"', response.data) + + def test_nhif_outpatient_cs_endpoint_with_keyword_only(self): + """ + This tests running nhif-outpatient-cs endpoint with correct available keyword only + """ + response = self.client.get("search?q=outpatient-cs insurance") + self.assertIn(b'"status": "FAILED"', response.data) + + def test_nhif_outpatient_cs_endpoint_without_query(self): + """ + This tests running nhif-outpatient-cs endpoint without query + """ + response = self.client.get("search?q=") + self.assertIn(b'"status": "FAILED"', response.data) + + def test_nhif_outpatient_cs_endpoint_with_nonkeyword(self): + """ + This tests running nhif-outpatient-cs endpoint with a keyword that is unavailable. + """ + response = self.client.get("search?q=maji Kilifi") + self.assertIn(b'"status": "FAILED"', response.data) From b462139a495fc81a030c94c1f700a8a18006a6e4 Mon Sep 17 00:00:00 2001 From: Awinja-Andela Date: Thu, 5 Oct 2017 17:01:20 +0300 Subject: [PATCH 09/18] added nurses --- healthtools/tests/nurse.py | 54 +++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/healthtools/tests/nurse.py b/healthtools/tests/nurse.py index 24cad54..6f747d1 100644 --- a/healthtools/tests/nurse.py +++ b/healthtools/tests/nurse.py @@ -24,14 +24,17 @@ def test_gets_nurses_from_nc_registry(self): def test_gets_nurses_from_nc_registry_handle_inexistent_nurse(self): nurses = get_nurses_from_nc_registry("ihoafiho39023u8") self.assertEqual(len(nurses), 0) - self.assertIn - + class TestNursesAPI(TestSetup): """ This tests nurses search api with defined doctype """ + def test_nurses_endpoint_handles_bad_query(self): + """ + This tests running nurses endpoint with valid doctype and no query + """ response = self.client.get("search/nurses?q=") self.assertIn(b'"status": "FAILED"', response.data) @@ -46,11 +49,25 @@ def test_nurses_endpoint_can_retrieve_cached_result(self): response = self.client.get("search/nurses?q=Marie") self.assertIn(b"X-Retrieved-From-Cache", response.headers.keys()) + def test_nurses_endpoint_with_bad_endpoint(self): + """ + This tests running an endpoint with incorrect/unavailable doctype + """ + response = self.client.get("search/nurse?q=Marie") + self.assertIn(b'"status": "FAILED"', response.data) + + def test_nurses_endpoint_with_unavailable_query(self): + """ + This tests running nurses endpoint with correct doctype but unavailable query + """ + response = self.client.get("search/nurses?q=1234") + self.assertIn(b'"status": "FAILED"', response.data) + class TestNursesAPIWithoutDoctypes(TestSetup): """ - This tests nurses search api using keywords + This tests nurses search api without doctype, keywords are used instead """ - def test_nurses_endpoint_handles_bad_query(self): + def test_nurses_endpoint_endpoint_without_keyword_in_query(self): response = self.client.get("search?q=Marie") self.assertIn(b'"status": "FAILED"', response.data) @@ -58,4 +75,33 @@ def test_nurses_endpoint_gets_nurses(self): response = self.client.get("search?q=nurse Marie") self.assertIn(b"OK", response.data) self.assertIn(b"MARIE WANJUGU MURIGO", response.data) + + def test_nurses_endpoint_with_unavailable_query(self): + """ + This tests running nurses endpoint with correct available keyword but unavailable query + """ + response = self.client.get("search?q=Registered Nurse 1234") + self.assertIn(b'"status": "FAILED"', response.data) + + def test_nurses_cs_endpoint_with_keyword_only(self): + """ + This tests running nurses endpoint with correct available keyword only + """ + response = self.client.get("search?q=nursing officer") + self.assertIn(b'"status": "FAILED"', response.data) + + def test_nurses_endpoint_without_query(self): + """ + This tests running nurses endpoint without query + """ + response = self.client.get("search?q=") + self.assertIn(b'"status": "FAILED"', response.data) + + def test_nurses_endpoint_with_nonkeyword(self): + """ + This tests running nurses endpoint with a keyword that is unavailable. + """ + response = self.client.get("search?q=kijana Marie") + self.assertIn(b'"status": "FAILED"', response.data) + From 57313f33a6ab86cc7f267c0e1e0be9521acd2592 Mon Sep 17 00:00:00 2001 From: Awinja-Andela Date: Thu, 5 Oct 2017 18:00:56 +0300 Subject: [PATCH 10/18] modified test files --- healthtools/tests/clinical_officer.py | 20 +++----------------- healthtools/tests/doctor.py | 15 --------------- healthtools/tests/health_facilities.py | 14 -------------- healthtools/tests/nhif_inpatient.py | 14 -------------- healthtools/tests/nhif_outpatient.py | 14 -------------- healthtools/tests/nhif_outpatient_cs.py | 15 --------------- 6 files changed, 3 insertions(+), 89 deletions(-) diff --git a/healthtools/tests/clinical_officer.py b/healthtools/tests/clinical_officer.py index 0478f62..fa6f15e 100644 --- a/healthtools/tests/clinical_officer.py +++ b/healthtools/tests/clinical_officer.py @@ -29,22 +29,16 @@ def test_cos_endpoint_gets_clinical_officers(self): """ This tests running cos endpoint with valid doctype and query """ - response = self.client.get("search/clinical-officers?q=john") + response = self.client.get("search/clinical-officers?q=DABASO GARAMBODA") self.assertIn(b"OK", response.data) def test_cos_endpoint_with_bad_endpoint(self): """ This tests running an endpoint with incorrect/unavailable doctype """ - response = self.client.get("search/clinicalofficers?q=john") + response = self.client.get("search/clinicalofficers?q=DABASO GARAMBODA") self.assertIn(b'"status": "FAILED"', response.data) - def test_cos_endpoint_with_unavailable_query(self): - """ - This tests running cos endpoint with correct doctype but unavailable query - """ - response = self.client.get("search/clinical-officers?q=1234") - self.assertIn(b'"status": "FAILED"', response.data) class TestClinicalOfficersAPIWithoutDoctype(TestSetup): """ @@ -55,17 +49,9 @@ def test_cos_endpoint_without_keyword_in_query(self): self.assertIn(b'"status": "FAILED"', response.data) def test_cos_endpoint_gets_clinical_officers(self): - response = self.client.get("search?q=CO John") + response = self.client.get("search?q=clinical oficer DABASO GARAMBODA") self.assertIn(b"OK", response.data) - - def test_cos_endpoint_with_unavailable_query(self): - """ - This tests running cos endpoint with correct available keyword but unavailable query - """ - response = self.client.get("search?q= CO 1234") - self.assertIn(b'"status": "FAILED"', response.data) - def test_cos_endpoint_with_keyword_only(self): """ This tests running cos endpoint with correct available keyword only diff --git a/healthtools/tests/doctor.py b/healthtools/tests/doctor.py index 6e7ec6a..34c6c4b 100644 --- a/healthtools/tests/doctor.py +++ b/healthtools/tests/doctor.py @@ -39,13 +39,6 @@ def test_doctors_endpoint_with_bad_endpoint(self): response = self.client.get("search/doctor?q=john") self.assertIn(b'"status": "FAILED"', response.data) - def test_doctors_endpoint_with_unavailable_query(self): - """ - This tests running doctors endpoint with correct doctype but unavailable query - """ - response = self.client.get("search/doctors?q=1234") - self.assertIn(b'"status": "FAILED"', response.data) - class TestDoctorsAPIWithoutDoctype(TestSetup): """ This tests doctors search api without doctype, keywords are used instead @@ -57,15 +50,7 @@ def test_doctors_endpoint_without_keyword_in_query(self): def test_doctors_endpoint_gets_doctors(self): response = self.client.get("search?q=daktari John") self.assertIn(b"OK", response.data) - - def test_doctors_endpoint_with_unavailable_query(self): - """ - This tests running doctors endpoint with correct available keyword but unavailable query - """ - response = self.client.get("search?q= daktari 1234") - self.assertIn(b'"status": "FAILED"', response.data) - def test_doctors_endpoint_with_keyword_only(self): """ This tests running doctors endpoint with correct available keyword only diff --git a/healthtools/tests/health_facilities.py b/healthtools/tests/health_facilities.py index 80df2db..b557ea0 100644 --- a/healthtools/tests/health_facilities.py +++ b/healthtools/tests/health_facilities.py @@ -41,13 +41,6 @@ def test_health_facilities_endpoint_with_bad_endpoint(self): response = self.client.get("search/healthfacilities?q=Kitale") self.assertIn(b'"status": "FAILED"', response.data) - def test_health_facilities_endpoint_with_unavailable_query(self): - """ - This tests running health-facilities endpoint with correct doctype but unavailable query - """ - response = self.client.get("search/health-facilities?q=1234") - self.assertIn(b'"status": "FAILED"', response.data) - class TestHealthFacilitiesAPIWithoutDoctype(TestSetup): """ @@ -62,13 +55,6 @@ def test_health_facilities_endpoint_gets_health_facilities(self): response = self.client.get("search?q=dispensary Kilifi") self.assertIn(b"OK", response.data) - def test_health_facilities_endpoint_with_unavailable_query(self): - """ - This tests running health-facilities endpoint with correct available keyword but unavailable query - """ - response = self.client.get("search?q=sanatorium 1234") - self.assertIn(b'"status": "FAILED"', response.data) - def test_health_facilities_endpoint_with_keyword_only(self): """ This tests running health-facilities endpoint with correct available keyword only diff --git a/healthtools/tests/nhif_inpatient.py b/healthtools/tests/nhif_inpatient.py index 043344b..bbbe26a 100644 --- a/healthtools/tests/nhif_inpatient.py +++ b/healthtools/tests/nhif_inpatient.py @@ -41,13 +41,6 @@ def test_nhif_inpatient_endpoint_with_bad_endpoint(self): response = self.client.get("search/nhifinpatient?q=MATHARE") self.assertIn(b'"status": "FAILED"', response.data) - def test_nhif_inpatient_endpoint_with_unavailable_query(self): - """ - This tests running nhif-inpatient endpoint with correct doctype but unavailable query - """ - response = self.client.get("search/nhif-inpatient?q=1234") - self.assertIn(b'"status": "FAILED"', response.data) - class TestNhifInpatientAPIWithoutDoctype(TestSetup): """ @@ -62,13 +55,6 @@ def test_nhif_inpatient_endpoint_gets_nhif_inpatient(self): response = self.client.get("search?q=bima inpatient Kilifi") self.assertIn(b"OK", response.data) - def test_nhif_inpatient_endpoint_with_unavailable_query(self): - """ - This tests running nhif-inpatient endpoint with correct available keyword but unavailable query - """ - response = self.client.get("search?q=inpatient insurance 1234") - self.assertIn(b'"status": "FAILED"', response.data) - def test_nhif_inpatient_endpoint_with_keyword_only(self): """ This tests running nhif-inpatient endpoint with correct available keyword only diff --git a/healthtools/tests/nhif_outpatient.py b/healthtools/tests/nhif_outpatient.py index cf10bfe..5524538 100644 --- a/healthtools/tests/nhif_outpatient.py +++ b/healthtools/tests/nhif_outpatient.py @@ -41,13 +41,6 @@ def test_nhif_outpatient_endpoint_with_bad_endpoint(self): response = self.client.get("search/nhifoutpatient?q=BRISTOL") self.assertIn(b'"status": "FAILED"', response.data) - def test_nhif_outpatient_endpoint_with_unavailable_query(self): - """ - This tests running nhif-outpatient endpoint with correct doctype but unavailable query - """ - response = self.client.get("search/nhif-outpatient?q=1234") - self.assertIn(b'"status": "FAILED"', response.data) - class TestNhifOutpatientAPIWithoutDoctype(TestSetup): """ @@ -62,13 +55,6 @@ def test_nhif_outpatient_endpoint_gets_nhif_outpatient(self): response = self.client.get("search?q=bima outpatient Kilifi") self.assertIn(b"OK", response.data) - def test_nhif_outpatient_endpoint_with_unavailable_query(self): - """ - This tests running nhif-outpatient endpoint with correct available keyword but unavailable query - """ - response = self.client.get("search?q=outpatient insurance 1234") - self.assertIn(b'"status": "FAILED"', response.data) - def test_nhif_outpatient_endpoint_with_keyword_only(self): """ This tests running nhif-outpatient endpoint with correct available keyword only diff --git a/healthtools/tests/nhif_outpatient_cs.py b/healthtools/tests/nhif_outpatient_cs.py index c0a9d18..9695d32 100644 --- a/healthtools/tests/nhif_outpatient_cs.py +++ b/healthtools/tests/nhif_outpatient_cs.py @@ -41,14 +41,6 @@ def test_nhif_outpatient_cs_endpoint_with_bad_endpoint(self): response = self.client.get("search/nhifoutpatient-cs?q=BRISTOL") self.assertIn(b'"status": "FAILED"', response.data) - def test_nhif_outpatient_cs_endpoint_with_unavailable_query(self): - """ - This tests running nhif-outpatient-cs endpoint with correct doctype but unavailable query - """ - response = self.client.get("search/nhif-outpatient-cs?q=1234") - self.assertIn(b'"status": "FAILED"', response.data) - - class TestNhifOutpatientAPIWithoutDoctype(TestSetup): """ This tests nhif-outpatient-cs search api without doctype, keywords are used instead @@ -62,13 +54,6 @@ def test_nhif_outpatient_cs_endpoint_gets_nhif_outpatient_cs(self): response = self.client.get("search?q=bima outpatient-cs Kilifi") self.assertIn(b"OK", response.data) - def test_nhif_outpatient_cs_endpoint_with_unavailable_query(self): - """ - This tests running nhif-outpatient-cs endpoint with correct available keyword but unavailable query - """ - response = self.client.get("search?q=outpatient-cs insurance 1234") - self.assertIn(b'"status": "FAILED"', response.data) - def test_nhif_outpatient_cs_endpoint_with_keyword_only(self): """ This tests running nhif-outpatient-cs endpoint with correct available keyword only From dc861fb136549608cdfa44728c4063dcce20d840 Mon Sep 17 00:00:00 2001 From: Awinja-Andela Date: Sat, 7 Oct 2017 23:10:18 +0300 Subject: [PATCH 11/18] removed sys path lines --- .idea/HealthTools.API.iml | 12 + .idea/misc.xml | 4 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + .idea/workspace.xml | 619 ++++++++++++++++++++++++ healthtools/tests/clinical_officer.py | 11 +- healthtools/tests/doctor.py | 10 +- healthtools/tests/health_facilities.py | 11 +- healthtools/tests/nhif_inpatient.py | 11 +- healthtools/tests/nhif_outpatient.py | 11 +- healthtools/tests/nhif_outpatient_cs.py | 11 +- healthtools/tests/nurse.py | 10 +- 12 files changed, 670 insertions(+), 54 deletions(-) create mode 100644 .idea/HealthTools.API.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml diff --git a/.idea/HealthTools.API.iml b/.idea/HealthTools.API.iml new file mode 100644 index 0000000..6f63a63 --- /dev/null +++ b/.idea/HealthTools.API.iml @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..f466d71 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..6d5463b --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..6a1fdb6 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,619 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cos + ClinicalOfficers + co + Doctors + clin + doctor + doctors + nhif-inpatient + inpatient + outpatient + _outpatient + - + + + DoctorsOfficers + doctors + daktari + HealthFacilities + health-facilities + health_facilities + nhif-inpatient + nhif_inpatient + nhif_outpatient + nhif-outpatient + outpatient + outpatient-cs + _outpatient_cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1506505639290 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/healthtools/tests/clinical_officer.py b/healthtools/tests/clinical_officer.py index fa6f15e..7e2e53a 100644 --- a/healthtools/tests/clinical_officer.py +++ b/healthtools/tests/clinical_officer.py @@ -1,10 +1,6 @@ -import os -import inspect -import sys -currentdir = os.path.dirname(os.path.abspath( - inspect.getfile(inspect.currentframe()))) -parentdir = os.path.dirname(currentdir) -sys.path.insert(0, parentdir) +""" +This test for clinical officers end point +""" import unittest from healthtools.manage import app @@ -16,7 +12,6 @@ class TestClinicalOfficersAPIWithDoctype(TestSetup): """ This tests clinical officers search api with doctype """ - def test_cos_endpoint_without_query(self): """ This tests running cos endpoint with valid doctype and no query diff --git a/healthtools/tests/doctor.py b/healthtools/tests/doctor.py index 34c6c4b..786a034 100644 --- a/healthtools/tests/doctor.py +++ b/healthtools/tests/doctor.py @@ -1,10 +1,6 @@ -import os -import inspect -import sys -currentdir = os.path.dirname(os.path.abspath( - inspect.getfile(inspect.currentframe()))) -parentdir = os.path.dirname(currentdir) -sys.path.insert(0, parentdir) +""" +This test for doctors end point +""" import unittest from healthtools.manage import app diff --git a/healthtools/tests/health_facilities.py b/healthtools/tests/health_facilities.py index b557ea0..1e4e676 100644 --- a/healthtools/tests/health_facilities.py +++ b/healthtools/tests/health_facilities.py @@ -1,11 +1,6 @@ -import os -import inspect -import sys - -currentdir = os.path.dirname(os.path.abspath( - inspect.getfile(inspect.currentframe()))) -parentdir = os.path.dirname(currentdir) -sys.path.insert(0, parentdir) +""" +This test for health facilitites end point +""" import unittest from healthtools.manage import app diff --git a/healthtools/tests/nhif_inpatient.py b/healthtools/tests/nhif_inpatient.py index bbbe26a..585bbbc 100644 --- a/healthtools/tests/nhif_inpatient.py +++ b/healthtools/tests/nhif_inpatient.py @@ -1,11 +1,6 @@ -import os -import inspect -import sys - -currentdir = os.path.dirname(os.path.abspath( - inspect.getfile(inspect.currentframe()))) -parentdir = os.path.dirname(currentdir) -sys.path.insert(0, parentdir) +""" +This test for nhif inpatient end point +""" import unittest from healthtools.manage import app diff --git a/healthtools/tests/nhif_outpatient.py b/healthtools/tests/nhif_outpatient.py index 5524538..b37b036 100644 --- a/healthtools/tests/nhif_outpatient.py +++ b/healthtools/tests/nhif_outpatient.py @@ -1,11 +1,6 @@ -import os -import inspect -import sys - -currentdir = os.path.dirname(os.path.abspath( - inspect.getfile(inspect.currentframe()))) -parentdir = os.path.dirname(currentdir) -sys.path.insert(0, parentdir) +""" +This test for nhif outpatient end point +""" import unittest from healthtools.manage import app diff --git a/healthtools/tests/nhif_outpatient_cs.py b/healthtools/tests/nhif_outpatient_cs.py index 9695d32..d24196e 100644 --- a/healthtools/tests/nhif_outpatient_cs.py +++ b/healthtools/tests/nhif_outpatient_cs.py @@ -1,11 +1,6 @@ -import os -import inspect -import sys - -currentdir = os.path.dirname(os.path.abspath( - inspect.getfile(inspect.currentframe()))) -parentdir = os.path.dirname(currentdir) -sys.path.insert(0, parentdir) +""" +This test for nhif outpatient cs end point +""" import unittest from healthtools.manage import app diff --git a/healthtools/tests/nurse.py b/healthtools/tests/nurse.py index 6f747d1..bd4ef69 100644 --- a/healthtools/tests/nurse.py +++ b/healthtools/tests/nurse.py @@ -1,10 +1,6 @@ -import os -import inspect -import sys -currentdir = os.path.dirname(os.path.abspath( - inspect.getfile(inspect.currentframe()))) -parentdir = os.path.dirname(currentdir) -sys.path.insert(0, parentdir) +""" +This test for nurses end point +""" import unittest from healthtools.manage import app from healthtools.search.nurses import get_nurses_from_nc_registry From 47f04bfb8027fbcf987d813370963f4868fa6fca Mon Sep 17 00:00:00 2001 From: Awinja-Andela Date: Wed, 11 Oct 2017 08:09:57 +0300 Subject: [PATCH 12/18] removed unnecessary lines from manage.py --- healthtools/manage.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/healthtools/manage.py b/healthtools/manage.py index 5bee236..88cde81 100644 --- a/healthtools/manage.py +++ b/healthtools/manage.py @@ -1,10 +1,3 @@ -import os -import inspect -import sys -currentdir = os.path.dirname(os.path.abspath( - inspect.getfile(inspect.currentframe()))) -parentdir = os.path.dirname(currentdir) -sys.path.insert(0, parentdir) import logging from healthtools.core import create_app From 05f28ca536c0bcd19cc28082d9315143321e3977 Mon Sep 17 00:00:00 2001 From: Awinja-Andela Date: Mon, 16 Oct 2017 10:40:56 +0300 Subject: [PATCH 13/18] added .idea/ --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index da9dd55..330e6af 100644 --- a/.gitignore +++ b/.gitignore @@ -94,8 +94,10 @@ ENV/ # OS X *.DS_Store *.idea +*.idea/ # Telegram Bot SSL settings cert.pem private.key + From 68beb65e6ef87c6d6b2436cdb1fc569a0e782a39 Mon Sep 17 00:00:00 2001 From: Awinja-Andela Date: Mon, 16 Oct 2017 10:45:46 +0300 Subject: [PATCH 14/18] removed .idea folder --- .idea/HealthTools.API.iml | 12 - .idea/misc.xml | 4 - .idea/modules.xml | 8 - .idea/vcs.xml | 6 - .idea/workspace.xml | 619 -------------------------------------- 5 files changed, 649 deletions(-) delete mode 100644 .idea/HealthTools.API.iml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml diff --git a/.idea/HealthTools.API.iml b/.idea/HealthTools.API.iml deleted file mode 100644 index 6f63a63..0000000 --- a/.idea/HealthTools.API.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index f466d71..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 6d5463b..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 6a1fdb6..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,619 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - cos - ClinicalOfficers - co - Doctors - clin - doctor - doctors - nhif-inpatient - inpatient - outpatient - _outpatient - - - - - DoctorsOfficers - doctors - daktari - HealthFacilities - health-facilities - health_facilities - nhif-inpatient - nhif_inpatient - nhif_outpatient - nhif-outpatient - outpatient - outpatient-cs - _outpatient_cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1506505639290 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From d8fd812c7b27e9f05a7c057be3735a8c3477801c Mon Sep 17 00:00:00 2001 From: Awinja-Andela Date: Mon, 16 Oct 2017 10:47:19 +0300 Subject: [PATCH 15/18] removed test.zip --- healthtools/tests.zip | Bin 14382 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 healthtools/tests.zip diff --git a/healthtools/tests.zip b/healthtools/tests.zip deleted file mode 100644 index 383bf4c923c7aa5c2f6a781879b05b6e015603d1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14382 zcmaJ|1yt3`*QHCOyIZ=uySuv^=`LxI?(R;JkZuH|Tj}l+knRtjpFWKDzjqDm!dmB? zIWzn2-~nyeCPjW1N+m4T2Mhp!NJ zbNU%fk{iy+hQ5|yp#Fp;ak|ma)6AVHog$t zlW7ABRm1KyzjoGbUNV6p0HH00P4jJa_8Y{6Riz-pHFzf{4(NFCnxLv10Z9_W6|+mP zP-yXtw_$z$l$4mJ3ZfF^MNpeQupS8$ksm6&jTm&m+>04n(H-oUJZ z{vdqG$h2D9Px*pFoT5)PGd|+m<#9Zr_*$zSnK|g_P}{gZ;W#I5 zLairp;J0-UH{}1t9O0R{jjMs4fvJ&>&Oht;^aa9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Q-ZIZXWBBHg2!ZOWT0=BOLxNO z;;7X@h0gVes=JP$HIp*oM9ssoc<6?vzh!XCH522C=LuSBmSM_3kI-WIpU{H&7h3;x z&;F#UZp9^;xu-Lnjx7`{D}teE^J~%9C71bDzy%Q@EkY!%%wOa=F83?%FF05rDe`H1 zx;BGIoLia>Z@vzXRrj#NCLk=dnhCs2Xk{^z7DG=HSc`Y67>RZz^o*}IT89?09-s)3 zi3Z3l7v&b>8Dk1r{7NpRIXHMp6z)-fN;6NXhjWmr36+k@p<$Dna%Si^wn%toxVjHb z9#`|exrS+j!E7BVJ2Y0xp2uIdv8rFn#(z?z$~)%_i7uPgXvL1=y`G zH)BrFNbVjlg0Xw36=@nkHZF^AMTWz$OHOiPjWIf9rrHKwizyd@hA?X=k?;#s2YcHW zvq};Z4#&+!jC_>*qmX7swze->W>uoYn2UI4#z!!lW3hv&(JEfMiC&bvg)w=k)DAvX zWDhrUQeh8WQ`4^Z&JiY@U58%mfU)qR&(4Vv{;XP2hFi&1kbBIT(^zHK$24jvc**IpgYSeeR@7r|B|b+&UYJnL>shY0_3)Yw+}bAb5se$( zSxFx~t1^Yt5tRE2sq3Y^VQAFiqclq|(sKt|44ldbJDYPo4|*_G?8v}ZTYE2vc>XyM zxQ&U?nmvM6@ERS19|+WY_I;`vUqWa--bws9-9K7je}?*@mwz7WNgMlI_V((RP{WVd|1;EoC}qFr@}!h~ z9^gqm_gv;e|4V?Ej}5**1N?cm{xg{$TDs@4o`f^c@3U!siS-8lZ?S$me*GEfhm7WV zpeH;%zaFCfB@iIWe+GJ1iT@et$7T8RNKe;I&%2={zeK{s{A;AYUOqtp{J4C2?*EC+ zo;S$QfAODy_rw1m@cRB``%&xt?(%szUeM!}qzxv_xH(2~{htErAv|k)nkp1HD+4lc$kIyS6%wIf0QT~U=9|ib- mujTV68q6 Date: Mon, 16 Oct 2017 10:51:22 +0300 Subject: [PATCH 16/18] updated readme.md with nosetest commands --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 938c945..ff48b0a 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,16 @@ Install the dependencies by running `$ pip install -r requirements.txt` Use nosetests to run tests (with stdout) like this: ```$ nosetests --nocapture``` +```$ nosetests healthtools/tests``` +```$ nosetests healthtools/tests/doctor.py``` +```$ nosetests healthtools/tests/nurse.py``` +```$ nosetests healthtools/tests/clinical_officer.py``` +```$ nosetests healthtools/tests/health_facilities.py``` +```$ nosetests healthtools/tests/nhif_inpatient.py``` +```$ nosetests healthtools/tests/nhif_outpatient.py``` +```$ nosetests healthtools/tests/nhif_outpatient_cs.py``` + + ## Contributing From 6bd30f5d28335c3dfc855a11cf5ba9eb8cd9f685 Mon Sep 17 00:00:00 2001 From: Awinja-Andela Date: Tue, 17 Oct 2017 07:35:38 +0300 Subject: [PATCH 17/18] spacing nosetests commands --- README.md | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index ff48b0a..7599735 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ The HealthTools API provides a simple wrapper around Elasticsearch data being ma ? - ## Development Clone the repo from github `$ git clone https://github.com/CodeForAfricaLabs/HealthTools.API.git` @@ -21,22 +20,18 @@ Install the dependencies by running `$ pip install -r requirements.txt` ? - ### Tests Use nosetests to run tests (with stdout) like this: -```$ nosetests --nocapture``` -```$ nosetests healthtools/tests``` -```$ nosetests healthtools/tests/doctor.py``` -```$ nosetests healthtools/tests/nurse.py``` -```$ nosetests healthtools/tests/clinical_officer.py``` -```$ nosetests healthtools/tests/health_facilities.py``` -```$ nosetests healthtools/tests/nhif_inpatient.py``` -```$ nosetests healthtools/tests/nhif_outpatient.py``` -```$ nosetests healthtools/tests/nhif_outpatient_cs.py``` - - - + ```$ nosetests --nocapture``` + ```$ nosetests healthtools/tests``` + ```$ nosetests healthtools/tests/doctor.py``` + ```$ nosetests healthtools/tests/nurse.py``` + ```$ nosetests healthtools/tests/clinical_officer.py``` + ```$ nosetests healthtools/tests/health_facilities.py``` + ```$ nosetests healthtools/tests/nhif_inpatient.py``` + ```$ nosetests healthtools/tests/nhif_outpatient.py``` + ```$ nosetests healthtools/tests/nhif_outpatient_cs.py``` ## Contributing From ab9d6dcdb434c364075656800bc7a7507c18a3d9 Mon Sep 17 00:00:00 2001 From: David Lemayian Date: Wed, 18 Oct 2017 17:26:52 +0300 Subject: [PATCH 18/18] Update README.md --- README.md | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 7599735..bdc5873 100644 --- a/README.md +++ b/README.md @@ -22,16 +22,19 @@ Install the dependencies by running `$ pip install -r requirements.txt` ### Tests -Use nosetests to run tests (with stdout) like this: - ```$ nosetests --nocapture``` - ```$ nosetests healthtools/tests``` - ```$ nosetests healthtools/tests/doctor.py``` - ```$ nosetests healthtools/tests/nurse.py``` - ```$ nosetests healthtools/tests/clinical_officer.py``` - ```$ nosetests healthtools/tests/health_facilities.py``` - ```$ nosetests healthtools/tests/nhif_inpatient.py``` - ```$ nosetests healthtools/tests/nhif_outpatient.py``` - ```$ nosetests healthtools/tests/nhif_outpatient_cs.py``` +Use nosetests to run tests (with stdout) like so: + +```sh +$ nosetests --nocapture +$ nosetests healthtools/tests +$ nosetests healthtools/tests/doctor.py +$ nosetests healthtools/tests/nurse.py +$ nosetests healthtools/tests/clinical_officer.py +$ nosetests healthtools/tests/health_facilities.py +$ nosetests healthtools/tests/nhif_inpatient.py +$ nosetests healthtools/tests/nhif_outpatient.py +$ nosetests healthtools/tests/nhif_outpatient_cs.py +``` ## Contributing