66
77@mock .patch ("routes.v1.company.utils.get_company_by_name" )
88@mock .patch ("logger.log.logger.debug" )
9- def test_company (mock_logger_debug ,
10- mock_get_company_by_name , client ):
9+ def test_company (mock_logger_debug , mock_get_company_by_name , client ):
1110 mock_logger_debug .return_value = "Ok"
1211 mock_get_company_by_name .return_value = {"id" : 12345 }
1312 response = client .get ("/api/v1/company/test-company/" )
@@ -17,8 +16,9 @@ def test_company(mock_logger_debug,
1716
1817@mock .patch ("routes.v1.company.utils.get_company_by_name" )
1918@mock .patch ("logger.log.logger.debug" )
20- def test_company_for_hubspot_company_exception (mock_logger_debug ,
21- mock_get_company_by_name , client ):
19+ def test_company_for_hubspot_company_exception (
20+ mock_logger_debug , mock_get_company_by_name , client
21+ ):
2222 mock_logger_debug .return_value = "Ok"
2323 mock_get_company_by_name .side_effect = CompanyException (
2424 "Something went wrong in fetching company from Hubspot"
@@ -44,8 +44,9 @@ def test_create_company(mock_logger_debug, mock_create_company, client):
4444
4545@mock .patch ("routes.v1.company.utils.create_company" )
4646@mock .patch ("logger.log.logger.debug" )
47- def test_create_company_with_hubspot_company_exception (mock_logger_debug , mock_create_company ,
48- client , db ):
47+ def test_create_company_with_hubspot_company_exception (
48+ mock_logger_debug , mock_create_company , client , db
49+ ):
4950 mock_logger_debug .return_value = "Ok"
5051 mock_create_company .side_effect = CompanyException (
5152 "Something went wrong in creating company in Hubspot"
@@ -62,30 +63,32 @@ def test_create_company_with_hubspot_company_exception(mock_logger_debug, mock_c
6263
6364
6465@mock .patch ("logger.log.logger.debug" )
65- def test_create_company_with_duplicate_organization_org_id (mock_logger_debug ,
66- client , organization ):
66+ def test_create_company_with_duplicate_organization_org_id (
67+ mock_logger_debug , client , organization
68+ ):
6769 mock_logger_debug .return_value = "Ok"
6870 response = client .post (
6971 "/api/v1/companies/" , json = {"org_id" : 12345 , "name" : "UWISO" }
7072 )
7173 assert response .status_code == 200
7274 assert response .json () == {
7375 "detail" : "duplicate key value violates unique constraint "
74- '"organization_org_id_key"\n DETAIL: Key (org_id)=('
75- "12345) already exists.\n "
76+ '"organization_org_id_key"\n DETAIL: Key (org_id)=('
77+ "12345) already exists.\n "
7678 }
7779
7880
7981@mock .patch ("logger.log.logger.debug" )
80- def test_create_company_with_duplicate_organization_name (mock_logger_debug ,
81- client , organization ):
82+ def test_create_company_with_duplicate_organization_name (
83+ mock_logger_debug , client , organization
84+ ):
8285 mock_logger_debug .return_value = "Ok"
8386 response = client .post (
8487 "/api/v1/companies/" , json = {"org_id" : 1232245 , "name" : "Test org" }
8588 )
8689 assert response .status_code == 200
8790 assert response .json () == {
8891 "detail" : "duplicate key value violates unique constraint "
89- '"organization_name_key"\n DETAIL: Key (name)=('
90- "Test org) already exists.\n "
92+ '"organization_name_key"\n DETAIL: Key (name)=('
93+ "Test org) already exists.\n "
9194 }
0 commit comments