def test_profile_parser_keywords(mock_tokenize_keywords): parser = helpers.CompanyParser({'keywords': 'thing,other'}) parser.keywords assert mock_tokenize_keywords.call_count == 1 assert mock_tokenize_keywords.call_args == mock.call('thing,other')
def test_profile_parser_date_of_creation(value, expected): parser = helpers.CompanyParser({'date_of_creation': value}) assert parser.date_of_creation == expected
def test_profile_parser_(value, expected): parser = helpers.CompanyParser(value) assert bool(parser) is expected
def test_profile_parser_is_publishable(value, expected): parser = helpers.CompanyParser(value) assert parser.is_publishable == expected
def test_profile_parser_expertise_products_services_label(value, expected): parser = helpers.CompanyParser(value) assert parser.expertise_products_services_label == expected
def test_profile_parser_expertise_regions_label(value, expected): parser = helpers.CompanyParser(value) assert parser.expertise_regions_label == expected
def test_profile_parser_has_expertise(value, expected): parser = helpers.CompanyParser(value) assert parser.has_expertise is expected
def test_profile_parser_is_in_companies_house(value, expected): parser = helpers.CompanyParser({'company_type': value}) assert parser.is_in_companies_house is expected
def test_profile_parser_employees_label(value, expected): parser = helpers.CompanyParser({'employees': value}) assert parser.employees_label == expected
def test_profile_parser_sectors(value, expected): parser = helpers.CompanyParser({'sectors': value}) assert parser.sectors_label == expected
def test_profile_parser_keywords_joined(): parser = helpers.CompanyParser({'keywords': 'thing,other'}) assert parser.keywords == 'thing, other'
def test_profile_parser_keywords_no_keyword(mock_tokenize_keywords, value): parser = helpers.CompanyParser({'keywords': value}) parser.keywords assert mock_tokenize_keywords.call_count == 0
def test_profile_parser_address(value, expected): parser = helpers.CompanyParser(value) assert parser.address == expected