Repository URL to install this package:
|
Version:
0.32.0 ▾
|
from django.test import TestCase
from dockerhub.marketo.adapter import LeadManagerImpl
class TestLeadManagerScrubExtraValues(TestCase):
def setUp(self):
self.lead_fields_empty_data = {
'hubUsername': None,
'plan_type': None,
'firstName': None,
'lastName': None,
'company': None,
'country': None,
}
self.lead_fields_partial_data = {
'hubUsername': 'rogaha',
'plan_type': None,
'firstName': None,
'lastName': None,
'company': None,
'country': None,
}
self.lead_fields_full_data = {
'hubUsername': 'rogaha',
'plan_type': 'Starter',
'firstName': 'test1',
'lastName': 'test2',
'company': 'company1',
'country': 'USA',
}
def test_empty_extra_values_data(self):
result = LeadManagerImpl._scrub_extra_values(
self.lead_fields_empty_data)
# _scrub_extra_values() should return an empty dictionary
self.assertEqual(len(result), 0)
self.assertEqual(result, {})
def test_full_extra_values_data(self):
result = LeadManagerImpl._scrub_extra_values(
self.lead_fields_full_data)
# _scrub_extra_values() should return a dictionary with all values
self.assertEqual(len(result), len(self.lead_fields_full_data))
self.assertEqual(result, self.lead_fields_full_data)
def test_partial_extra_values_data(self):
result = LeadManagerImpl._scrub_extra_values(
self.lead_fields_partial_data)
# _scrub_extra_values() should return a dictionary with one value
self.assertEqual(len(result), 1)
self.assertEqual(result['hubUsername'],
self.lead_fields_partial_data['hubUsername'])