コード例 #1
0
 def test_hard_input_three(self):
     # Todo: make sure that your program assert only string.
     with self.assertRaises(TypeError):
         self.assertEqual(counter(41), 0)
コード例 #2
0
 def test_hard_input(self):
     # Todo: make sure that the program raises an exception whenever an empty string is given.
     with self.assertRaises(TypeError):
         self.assertEqual(counter(""), 0)
コード例 #3
0
 def test_hard_input_two(self):
     # Todo: make sure that your program does not accept a None input.
     with self.assertRaises(TypeError):
         self.assertEqual(counter(None), 0)
コード例 #4
0
 def test_easy_input(self):
     self.assertEquals(counter("rajni"), 5)
コード例 #5
0
 def test_medium_input_two(self):
     # Todo: make sure that your program does not count paces. It should only count english alpha.
     self.assertEqual(counter("Mohammad Mahjoub"), 15)
コード例 #6
0
 def test_medium_input(self):
     with self.assertRaises(ValueError):
         self.assertEquals(counter("M%$#98"), 6)
コード例 #7
0
 def test_hard_input(self):
     with self.assertRaises(ValueError):
         self.assertEquals(counter(""), 0)
コード例 #8
0
 def test_medium_input_two(self):
     self.assertEqual(counter('Joanna White'), 11)
コード例 #9
0
 def test_hard_input(self):
     with self.assertRaises(Exception):
         self.assertEqual(counter(' '), 0)
コード例 #10
0
 def test_easy_input_two(self):
     self.assertEqual(counter('Joanna'), 6)
コード例 #11
0
 def test_medium_input(self):
     with self.assertRaises(Exception):
         self.assertEqual(counter('Jo!@#$%^'), 2)
コード例 #12
0
 def test_easy_input_two(self):
     # Todo: make sure that your program returns 8 given the string 'Mohammad'
     self.assertEqual(counter("Mohammad"), 8)
コード例 #13
0
 def test_easy_input(self):
     # Todo: make sure that your program returns 2 given the string 'Mo'
     self.assertEqual(counter("Mo"), 2)
コード例 #14
0
 def test_hard_input(self):
     with self.assertRaises(Exception):
         # Todo: make sure that your program does not accept an empty string.
         self.assertEqual(counter(""), 0)
コード例 #15
0
 def test_easy_input(self):
     self.assertEqual(counter("Leksus"), 6)
コード例 #16
0
 def test_hard_input_two(self):
     with self.assertRaises(AttributeError):
         self.assertEqual(counter(None), 0)
コード例 #17
0
 def test_easy_input_two(self):
     self.assertEqual(counter("Alina"), 5)
コード例 #18
0
 def test_easy_input(self):
     self.assertEqual(counter('Jo'), 2)
コード例 #19
0
 def test_medium_input_two(self):
     with self.assertRaises(ValueError):
         self.assertEquals(counter("raj  ni"), 7)
コード例 #20
0
 def test_medium_input(self):
     # Todo: make sure that the program raises an exception whenever there is any non-english charts. Ex. !@#$%^.
     with self.assertRaises(TypeError):
         self.assertEqual(counter("Alin@"), 5)
コード例 #21
0
 def test_hard_input_two(self):
     with self.assertRaises(ValueError):
         self.assertEquals(counter(None), 4)
コード例 #22
0
 def test_medium_input_two(self):
     # Todo: make sure that your program does not count paces. It should only count english alpha.
     self.assertEqual(counter("Alina Kotik"), 10)
コード例 #23
0
 def test_easy_input_two(self):
     self.assertEquals(counter("MO"), 2)
コード例 #24
0
 def test_medium_input(self):
     with self.assertRaises(Exception):
         # Todo: make sure that the program raises an exception whenever there is any non-english charts.
         self.assertEqual(counter("Mo?."), 4)