예제 #1
0
 def test_parse_non_negative_integer(self):
   self.assertEqual(0, parsing.parse_non_negative_integer('0'))
   self.assertEqual(1234, parsing.parse_non_negative_integer('1234'))
   self.assertRaises(ValueError,
       lambda: parsing.parse_non_negative_integer(''))
   self.assertRaises(ValueError,
       lambda: parsing.parse_non_negative_integer('-1234'))
예제 #2
0
 def test_parse_non_negative_integer(self):
     self.assertEqual(0, parsing.parse_non_negative_integer('0'))
     self.assertEqual(1234, parsing.parse_non_negative_integer('1234'))
     self.assertRaises(ValueError,
                       lambda: parsing.parse_non_negative_integer(''))
     self.assertRaises(ValueError,
                       lambda: parsing.parse_non_negative_integer('-1234'))
예제 #3
0
 def test_parse_query_count(self):
   self.assertEqual(100, parsing.parse_query_count(''))
   self.assertEqual(0, parsing.parse_query_count('0'))
   self.assertEqual(123, parsing.parse_query_count('123'))
   self.assertEqual(1000, parsing.parse_query_count('1234'))
   self.assertRaises(ValueError,
       lambda: parsing.parse_non_negative_integer('pants'))
   self.assertRaises(ValueError,
       lambda: parsing.parse_non_negative_integer('-123'))
예제 #4
0
 def test_parse_query_count(self):
     self.assertEqual(100, parsing.parse_query_count(''))
     self.assertEqual(0, parsing.parse_query_count('0'))
     self.assertEqual(123, parsing.parse_query_count('123'))
     self.assertEqual(1000, parsing.parse_query_count('1234'))
     self.assertRaises(ValueError,
                       lambda: parsing.parse_non_negative_integer('pants'))
     self.assertRaises(ValueError,
                       lambda: parsing.parse_non_negative_integer('-123'))