def test_telecom_from_fhir(self): data = [{ "system": "phone", "value": "(+1) 734-677-7777" }, { "system": "fax", "value": "(+1) 734-677-6622" }, { "system": "email", "value": "*****@*****.**" }, { "system": "email", "value": "*****@*****.**" }] tc = Telecom.from_fhir(data) self.assertEquals(len(tc.contact_points), 3) self.assertEquals(tc.email, "*****@*****.**")
def test_telecom_from_fhir(self): data = [ { "system": "phone", "value": "(+1) 734-677-7777" }, { "system": "fax", "value": "(+1) 734-677-6622" }, { "system": "email", "value": "*****@*****.**" }, { "system": "email", "value": "*****@*****.**" } ] tc = Telecom.from_fhir(data) assert len(tc.contact_points) == 3 assert tc.email == "*****@*****.**"
def test_telecom_cp_dict(self): cp = ContactPoint(system='phone', use='work', value='123-4567') tc = Telecom(email='*****@*****.**', contact_points=[cp]) data = tc.cp_dict() self.assertEquals(len(data), 1) self.assertEquals(data.get(('phone', 'work')), '123-4567')
def test_telecom_as_fhir(self): cp = ContactPoint(system='phone', use='work', value='123-4567') tc = Telecom(email='*****@*****.**', contact_points=[cp]) data = tc.as_fhir() self.assertEquals(len(data), 2)
def test_telecom_cp_dict(self): cp = ContactPoint(system='phone', use='work', value='123-4567') tc = Telecom(email='*****@*****.**', contact_points=[cp]) data = tc.cp_dict() assert len(data) == 1 assert data.get(('phone', 'work')) == '123-4567'
def test_telecom_as_fhir(self): cp = ContactPoint(system='phone', use='work', value='123-4567') tc = Telecom(email='*****@*****.**', contact_points=[cp]) data = tc.as_fhir() assert len(data) == 2