Ejemplo n.º 1
0
    def test_shouldReturnEqual_OnExactlyTheSameString(self):
        # Given
        string = "some text"

        # When
        result = caseless_equal(string, string)

        # Then
        self.assertTrue(result)
Ejemplo n.º 2
0
    def test_shouldReturnEqual_OnStringsOfDifferentCases_AndForeignSpecialLetters(self):
        # Given
        string = "BẦu Straße"
        differentCaseString = "bầu strasse"

        # When
        result = caseless_equal(string, differentCaseString)

        # Then
        self.assertTrue(result)
Ejemplo n.º 3
0
    def test_shouldReturnEqual_OnStringsOfDifferentCases(self):
        # Given
        string = "sOmE text"
        differentCaseString = "SoMe TeXt"

        # When
        result = caseless_equal(string, differentCaseString)

        # Then
        self.assertTrue(result)
Ejemplo n.º 4
0
    def test_shouldReturnNotEqual_OnStrictlyDifferentStrings(self):
        # Given
        string = "some text"
        differentString = "different text"

        # When
        result = caseless_equal(string, differentString)

        # Then
        self.assertFalse(result)
Ejemplo n.º 5
0
 def is_good_answer(self, answer, translation):
     return caseless_equal(translation.word_to_learn, answer)
Ejemplo n.º 6
0
 def is_good_answer(self, answer, translation):
     return caseless_equal(translation.word_to_learn, answer)