예제 #1
0
 def test_no_phone_number(self):
     input = {'name': 'John'}
     with self.assertRaises(exceptions.BadRequestException):
         citizens.create(input)
예제 #2
0
 def test_good_creation(self, find_mock: mock.Mock):
     input = {'name': 'John', 'phone_number': '+31612345678'}
     output = citizens.create(input)
     self.assertDictEqual(output, input)
예제 #3
0
 def test_phone_number_gets_formatted(self, find_mock: mock.Mock):
     input = {'name': 'John', 'phone_number': '06 123-45678'}
     expected = {'name': 'John', 'phone_number': '+31612345678'}
     output = citizens.create(input)
     self.assertDictEqual(output, expected)
예제 #4
0
 def test_citizen_exists(self, find_mock: mock.Mock):
     input = find_mock.return_value
     with self.assertRaises(exceptions.AlreadyExistsException):
         citizens.create(input)