Example #1
0
 def test_unknown(self):
     self.assertEqual(TypeOfAddress.decode('80'), {
         'ton': 'unknown',
         'npi': 'unknown'
     })
     self.assertEqual(
         TypeOfAddress.encode({
             'ton': 'unknown',
             'npi': 'unknown'
         }), '80')
Example #2
0
 def test_encode_invalid_dict(self):
     with self.assertRaises(ValueError):
         TypeOfAddress.encode({})
Example #3
0
 def test_encode_invalid_ton(self):
     with self.assertRaises(ValueError):
         TypeOfAddress.encode({'npi': 'isdn', 'ton': 'strange'})
Example #4
0
 def test_encode_invalid_npi(self):
     with self.assertRaises(ValueError):
         TypeOfAddress.encode({'npi': 'strange', 'ton': 'international'})