예제 #1
0
 def test_no_equal(self):
     self.assertEqual(inverse_captcha([1, 2]), 0)
예제 #2
0
 def test_step_half(self):
     self.assertEqual(inverse_captcha([1, 2, 1, 2], 2), 6)
     self.assertEqual(inverse_captcha([1, 2, 2, 1], 2), 0)
     self.assertEqual(inverse_captcha_from_string('123425', 3), 4)
     self.assertEqual(inverse_captcha_from_string('123123', 3), 12)
     self.assertEqual(inverse_captcha_from_string('12131415', 4), 4)
예제 #3
0
 def test_empty(self):
     self.assertEqual(inverse_captcha([]), 0)
예제 #4
0
 def test_wrapping(self):
     self.assertEqual(inverse_captcha([9, 1, 9]), 9)
예제 #5
0
 def test_given(self):
     self.assertEqual(inverse_captcha([1, 1, 2, 2]), 3)
     self.assertEqual(inverse_captcha([1, 1, 1, 1]), 4)
     self.assertEqual(inverse_captcha([1, 2, 3, 4]), 0)
     self.assertEqual(inverse_captcha([9, 1, 2, 1, 2, 1, 2, 9]), 9)
예제 #6
0
def test_inverse_captcha():
    assert inverse_captcha([1, 1, 2, 2]) == 3
    assert inverse_captcha([1, 1, 1, 1]) == 4
    assert inverse_captcha([1, 2, 3, 4]) == 0
    assert inverse_captcha([9, 1, 2, 1, 2, 1, 2, 9]) == 9
예제 #7
0
 def test_simple(self):
     self.assertEqual(inverse_captcha([1, 1, 5]), 1)
 def test_results(self):
     self.assertEqual(inverse_captcha('1122'), 3)
     self.assertEqual(inverse_captcha('1111'), 4)
     self.assertEqual(inverse_captcha('1234'), 0)
     self.assertEqual(inverse_captcha('91212129'), 9)
예제 #9
0
 def test_inverse_captcha_of_1111_is_4(self):
     self.assertEquals(4, inverse_captcha.inverse_captcha(1111))
예제 #10
0
 def test_inverse_captcha_of_1122_is_3(self):
     self.assertEquals(3, inverse_captcha.inverse_captcha(1122))
예제 #11
0
 def test_inverse_captcha_of_91212129_is_9(self):
     self.assertEquals(9, inverse_captcha.inverse_captcha(91212129))
예제 #12
0
 def test_inverse_captcha_of_1234_is_0(self):
     self.assertEquals(0, inverse_captcha.inverse_captcha(1234))